-
-
Notifications
You must be signed in to change notification settings - Fork 304
Description
First, I want to say thanks for this great project and the still ongoing development of new features 👍. I currently switch to Buku as my default CLI bookmark manager. I've also tested shiori, but it definitely lacks support for many features (still in a very early state of development) and I want to use a already stable-proven and "production-ready" app.
Firefox “Keyword Searches”
There is one bookmark feature of Firefox I don't want to miss anymore and it seems like it is really “underused” which may be due to its unfamiliarity: Keyword Searches or also know as FAQ question “How to search IMDB, Wikipedia and more from the address bar”.
I was a bit confused after playing around with buku and reading through the documentation about the usage of the word “keyword” (or “search keyword”) which should be better described with the word “search term” or “search pattern”. In the context of Firefox bookmarks it is a bit misleading due to the “keyword” feature.
In short, the “Keyword Search” Firefox feature allows to add a keyword to a bookmark.
This allows to quickly use the search function a specific site, which is the same as web search engines (based on the Open Search Standard, by entering the keyword followed by a whitespace and then the actual search term.
Example using the keyword ghs
(GitHub Stars) to search my own GitHub stars for react
:
ghs react
The URL of the bookmark would be https://github.com/arcticicestudio?tab=stars&q=%s
where the %s
will be replaced with the search term where special characters will escaped automatically. See the Mozilla knowledge base documentation for more details about the advantages of using a captial %S
.
Note that a bookmark's keywords should not be confused with tags! These are two different features. Also note that the keyword feature is not limited to Firefox but also available for other browsers like Google Chrome and Chromium.
Current compatibility with buku
Anyway, I've tested the import & export feature of buku and noticed that the keyword of bookmark that has been created with Firefox will be lost when beeing imported in buku. So when exporting the buku database as .html
file and import it into Firefox the keywords will be lost.
Using the Firefox function “Export Bookmarks to HTML…” from within the bookmark manager window will create a file content like this when only one bookmark has been created that includes a keyword assignment (same example like above):
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks Menu</H1>
<DL><p>
<DT><A HREF="https://github.com/arcticicestudio?tab=repositories&q=%s" ADD_DATE="1536134961" LAST_MODIFIED="1536134973" SHORTCUTURL="ghs">GitHub Stars</A>
</DL>
Note the SHORTCUTURL
property on the <A>
tag stores the defined keyword of the bookmark. Importing this file into buku via buku --import path/to/bookmark.html
will now result in a data loss in form of all keywords.
Feature request
What I'd like to request for buku is a new feature that allows to
- Add a keyword to a bookmark via the CLI e.g. with
-k
/--keyword
followed by one keyword.- buku need to check if there are more than one and if yes deny the creation
- buku must validate that the keyword contains no whitespaces and special characters
- Optional: A nice to have would be to check if the keyword is unique, means it has not been used for another bookmark. As far as I know Firefox doesn't check for it so it would be a nice addition to ensure all keywords are unique.
- Add support for keywords when exporting the buku database so these can be easily used again in Firefox
- Add support for already defined keywords (
SHORTCUTURL
prop) when importing bookmarks
Unfortunately my free time is limited, otherwise I'd like to get deeper into code of the buku and submit a PR. If there are any questions regarding this request feel free to ask 😄