Zim

[Feature Request] BookmarksBar Plugin

Bug #1489944 reported by Pl on 2015-08-28
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Zim
Undecided
Unassigned

Bug Description

I am actively using Journal plugin and that means that I have lots of pages. I found that it would be nice to quickly switch between some pages to edit them or to quickly move between different places in index. Also some pages have important information and it would be useful to have them always at hand.

So I decided to make a plugin to create bookmarks which are placed in a bar and are easily seen and accessible.

With this plugin you will be able to quickly switch between different pages,
create bookmarks of some important pages to open them later in the notebook (or in a new window),
save currently opened page as bookmark (or set existing bookmark to this page) to return to it later,
also you can use bookmarks together with other Zim Pathbars (history, recent pages etc.) to navigate more easily.

Bookmarks can be saved between sessions or be deleted after closing the program.
For more information read the help file.

Since I am not a Python professional and English isn't my native language any recommendations regarding plugin and translation will be welcome. Testing and finding bugs is also appreciated.

There are 4 files:
bookmarksbar.py - plugin,
bookmarksbar_test.py - test of the plugin functionality (you don't need it to run the plugin),
bookmarksbar.txt - help,
add-bookmark.png - an icon (to install it just copy it to the 'pixmap' folder).

Pl (plprgt) wrote :

Plugin is updated.

Change log:
- The icon is added to the button in the toolbar (though you should install it by yourself - just copy 'add-bookmark.png' file to the 'pixmap' folder).
- Now it is possible to add bookmark from the Index (from the popup menu).
- Some minor changes.

Pl (plprgt) wrote :
sojusnik (sojusnik) wrote :

This handy plugin will certainly be of good service to all of us, thank you!

Would it be possible to add an option not to show the full namespace of a bookmark?

A more elegant way to solve the empty bookmark icon in the toolbar would be to point to an already existing icon from a default icon set, like it's done with the default Zim icons, to avoid manually copying the "add-bookmark.png" to the pixmaps folder.

Best wishes!

Pl (plprgt) wrote :

Thanks, I am glad that other people find my plugin useful.

Re: "Would it be possible to add an option not to show the full namespace of a bookmark?"
It is possible, but it can lead to confusion. For example, in case of dates 5.5.15, 5.6.15 and 5.1.14 you will see three bookmarks with the name 5. It may be OK to use in default pathbars like recent pages or history where you remember what you have seen, but in case of bookmarks I don't think it is worth to introduce.

Re: "A more elegant way to solve the empty bookmark icon in the toolbar would be... "
I agree, but unfortunately there are not many icons available.

description: updated
description: updated
Pl (plprgt) wrote :

Plugin is updated.
If you have used this plugin before keep in mind that now you should first click on the button in the toolbar to make the bar with bookmarks visible.

Change log:
- Now the button in the toolbar toggles between hiding and showing the bar with bookmarks. To add bookmarks use a new plus button in the bar or popup menu in the Index.
- Some minor changes.

sojusnik (sojusnik) wrote :

> Re: "Would it be possible to add an option not to show the full namespace of a bookmark?"
>
> It is possible, but it can lead to confusion. For example, in case of dates 5.5.15, 5.6.15 and 5.1.14 you will see three bookmarks with the name 5. It may be OK to use in default pathbars like recent pages or history where you remember what you have seen, but in case of bookmarks I don't think it is worth to introduce.

Yes, it definitely makes sense to have the full namespace with dates, but nevertheless, an option in the right click menu of the bookmarks bar would be very to useful for users like me, who don't use note titles with dates. At the moment some of my bookmarks take a lot of space in the bookmarks bar, because of the full namespace.

sojusnik (sojusnik) wrote :

Have a look at the tags plugin made by Fabian Moser in the built-in Zim plugins, to see how the "Show full page name" option was implemented.

Pl (plprgt) wrote :

Plugin is updated.

Change log:
- The option to show full/short page names is added to the popup menu of the Plus button.
- Since now it is possible to use short page names, bookmarks will occupy less space and therefore the maximum number of bookmarks is increased to 15.
- A new option to add new bookmarks from the beginning of the bar is added.
- The plus button has now an additional role of an indicator. It changes its icon when the number of bookmarks is maximum and blinks if a new bookmark is already in the bar.
- The keyboard shortcuts are added. Use <F4> to hide/show the bar and <Alt1> to add a new bookmark for the currently opened page.
- Now it is possible to reorder bookmarks via using new Copy/Paste menu options.
- A new feature of renaming bookmarks is added. May be useful where pages can't be easily renamed (e.g. dates in Journal). Also it allows to mark bookmarks more distinctively by using names with characters which are not allowed in Zim for pages (like *$@!%^).

Pl (plprgt) wrote :
Pl (plprgt) wrote :
Pl (plprgt) wrote :
sojusnik (sojusnik) wrote :

Thanks for the new release!

Just wanted to know if there is a certain reason, that the "show full or short page name" is in the context menu of the green plus button, instead the plugin options or the context menu of the bookmarks bar itself?

To right click on the plus button seems to me not very intuitive and could be missed by a person, who normally doesn't read the changelog or the feature list of this plugin respectively.

Pl (plprgt) wrote :

> Just wanted to know if there is a certain reason, that the "show full or short page name"...

It is not convenient to go often through menus to the plugin options to toggle it and I don't want to put many additional settings (especially which affect the whole bar) to the bookmark's popup menu. Moreover in the future there may be a need to add additional plugin options and it isn't clear where to put them. Popup menu for the plus button seems to be one of such places. It isn't intuitive but if you know it, it seems to be a rather convenient place.

It may be worth to change the icon of the plus button but then again its function to add new bookmarks will be not intuitive. I can add to the plus button a tooltip like “Add bookmark/ Change settings” if it will help. Also reading help is a good practice :)

Added this plugin to the main release branch - see revision 770

Made a couple of small changes:
1/ Made preference to save bookmarks "True" by default - I believe this is what users will expect
2/ Changed indenting to use Tab instead of 4xSpace -- found & fixed some irregularities in the indenting
3/ Added a "try .. except .." block in the "teardown" method to prevent errors in the test suite

Thanks again for this plugin !

Jaap

Changed in zim:
status: New → Fix Committed

Sorry for the spam, that should be 771 - stupid mistake: forgot to actually add the new files :(

Pl (plprgt) wrote :

Thank you for accepting my plugin.

I skimmed through 'bookmarksbar.py' in rev. 775 and there are some errors in indentation which seemingly occurred during convertion from 4xSpaces to Tabs.

I also added some minor changes to default settings which I think would be more convenient for users:
- Since tooltips are now accessible I set short names to default. So by default bookmarksbar will look like other pathbars in Zim.
- Also now after enabling the plugin for the first time the bar will be visible so people can see it right away without pressing the button.

All changes compared to 775 rev. are in attachement.

Changed in zim:
status: Fix Committed → New

Thanks for checking - merged in rev 782

Changed in zim:
status: New → Fix Committed
Changed in zim:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers