Various fixes after code review.

* Move documentation changes of bookmark / quickmarks to docstrings, as the
  asciidoc is autogenerated from those
* Fix some whitespaces in the BDD test cases
* Improved docstring in qute_bookmarks handler
This commit is contained in:
David Vogt 2016-07-23 14:27:42 +02:00
parent 11bf5c8809
commit 1f320b8686
5 changed files with 10 additions and 9 deletions

View File

@ -122,8 +122,6 @@ Save the current page as a bookmark, or a specific url.
If no url and title are provided, then save the current page as a bookmark. If a url and title have been provided, then save the given url as a bookmark with the provided title.
You can view all saved bookmarks on the link:qute://bookmarks[bookmarks page].
==== positional arguments
* +'url'+: url to save as a bookmark. If None, use url of current page.
* +'title'+: title of the new bookmark.
@ -514,8 +512,6 @@ Syntax: +:quickmark-add 'url' 'name'+
Add a new quickmark.
You can view all saved quickmarks on the link:qute://bookmarks[bookmarks page].
==== positional arguments
* +'url'+: The url to add as quickmark.
* +'name'+: The name for the new quickmark.

View File

@ -1104,6 +1104,9 @@ class CommandDispatcher:
If a url and title have been provided, then save the given url as
a bookmark with the provided title.
You can view all saved bookmarks on the
link:qute://bookmarks[bookmarks page].
Args:
url: url to save as a bookmark. If None, use url of current page.
title: title of the new bookmark.

View File

@ -178,6 +178,9 @@ class QuickmarkManager(UrlMarkManager):
def quickmark_add(self, win_id, url, name):
"""Add a new quickmark.
You can view all saved quickmarks on the
link:qute://bookmarks[bookmarks page].
Args:
win_id: The window ID to display the errors in.
url: The url to add as quickmark.

View File

@ -264,9 +264,8 @@ def qute_pdfjs(_win_id, request):
@add_handler('bookmarks')
def qute_bookmarks(_win_id, request):
"""Handler for qute:bookmarks. Show a list of all quickmarks / bookmarks"""
def qute_bookmarks(_win_id, _request):
"""Handler for qute:bookmarks. Display all quickmarks / bookmarks."""
bookmarks = sorted(objreg.get('bookmark-manager').marks.items(),
key=lambda x: x[1]) # Sort by title
quickmarks = sorted(objreg.get('quickmark-manager').marks.items(),

View File

@ -189,10 +189,10 @@ Feature: quickmarks and bookmarks
Scenario: Listing quickmarks
When I run :quickmark-add http://localhost:(port)/data/numbers/15.txt fifteen
And I run :quickmark-add http://localhost:(port)/data/numbers/14.txt fourteen
And I run :quickmark-add http://localhost:(port)/data/numbers/14.txt fourteen
And I open qute:bookmarks
Then the page should contain the plaintext "fifteen"
And the page should contain the plaintext "fourteen"
And the page should contain the plaintext "fourteen"
Scenario: Listing bookmarks
When I open data/title.html