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

View File

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

View File

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