Zim

[Feature Request] Update tags plugin to provide more flexibility on search

Bug #1363184 reported by Murat Güven
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Zim
Fix Released
Undecided
Unassigned

Bug Description

I find the tags plugin quite helpful to narrow down the list of tags which have pages in common.

But in my eyes it is quite slow to select the fist tag, if the tag list is long. To speed up the search for common tags and the related pages, I built a new plugin, based on this idea, but also including an auto completion entry and the search capability of zim.

Please find the plugin for both zim versions (060 and 061) attached.

To use the plugin, save the related .py file to the zim/plugins folder and activate within the zim/plugins menu.

There are some todos left:

* implement into the side pane
* use the zim index intersection function to speed up the down selection of common tags

Any feedback is welcome.

Have fun.
Murat

Murat Güven (muratg)
description: updated
description: updated
description: updated
description: updated
Revision history for this message
sojusnik (sojusnik) wrote :

Hey Murat!

Thanks for this plugin!

Can you specify the location of the plugins folder? I've copied this py-file to /usr/share/pyshared/zim/plugins/ but couldn't find it in the zim plugins menu to enable. Is there another plugins folder, preferable in the /home directory to copy this file in?

I'm on Ubuntu Gnome.

Best!

Revision history for this message
Murat Güven (murat-gueven) wrote :

Minor update for Linux to prevent overlapping of entry field and buttons.

Revision history for this message
Murat Güven (murat-gueven) wrote :

@sojusnik

To be honest, I'm not quite sure. This is what I do to test the plugins within Linux:

I use the extractd source files which you can download from here (http://zim-wiki.org/downloads.html).
In this package, there is a zim/plugins folder, where I store my plugins into.

Then I open a terminal, change directory to the zim folder and type:

sudo ./setup.py install

This installs zim with the new plugin into the dedicated system folders.

Hope, this helps.

Murat

Revision history for this message
Murat Güven (murat-gueven) wrote :

Found a little bug which occurs when removing the last selected tag.

Revision history for this message
Murat Güven (murat-gueven) wrote :

I've done following changes:

* Improved UI with more information which should work better on both Windows and Linux
* Replaced spinner by progress bar which gives a better indication of the progress
* Some fixes

Have fun!

This version is meant for ZimWiki 0.60

Revision history for this message
Murat Güven (murat-gueven) wrote :

I've done following changes:

* Improved UI with more information which should work better on both Windows and Linux
* Replaced spinner by progress bar which gives a better indication of the progress
* Some fixes

Have fun!

This version is meant for ZimWiki 0.61

Revision history for this message
sojusnik (sojusnik) wrote :

FYI, after this revision¹ plugins have to be in ~/.local/share/zim/plugins, as Jaap has stated recently².

¹ http://bazaar.launchpad.net/~jaap.karssenberg/zim/pyzim/revision/729
² https://lists.launchpad.net/zim-wiki/msg02958.html

Revision history for this message
Murat Güven (muratg) wrote :

I updated this plugin and added following value add / use case to it:

Use Case:
* You want to link pages within your current page which have a topic in common. As you have tagged these pages with the
same tag, you can use the tag to identify these pages.

So instead of searching through your pages and manually adding the dedicated pages as links you can use this plugin and
downselect all pages according to given tags and paste the result into the current page.

Any feedback welcome!

Have Fun,
Murat

P.S. I will discontinue the 0.60 version for Zim 0.60, so please update to the latest Zim version to benefit from this plugin

Revision history for this message
Murat Güven (muratg) wrote :

I updated this plugin based on the idea of Joel.

https://lists.launchpad.net/zim-wiki/msg03604.html

When you start the plugin it takes the word at the cursor position and looks up the word directly.
If that word is a tag, you get an overview of all pages with this tag and all related tags right away.

Revision history for this message
Murat Güven (muratg) wrote :

Minor update.

V1.15: If cursor is at empty line, don't go back to previous line / word and lookup a tag. Also changed search beaviour. Now looks for word which is right to the cursor instead of left

Murat Güven (muratg)
Changed in zim:
status: New → Fix Released
Revision history for this message
Nick (nick222-yandex) wrote :

Xubuntu 17.04-64

plugin from https://bugs.launchpad.net/zim/+bug/1363184/+attachment/4517491/+files/search_tagged_pages.py

This is zim 0.66
Platform: posix
Locale: ru_RU UTF-8
FS encoding: UTF-8
Python: (2, 7, 13, 'final', 0)
Gtk: (2, 24, 31)
Pygtk: (2, 24, 0)
No bzr version-info found

======= Traceback =======
  File "/usr/lib/python2.7/dist-packages/zim/actions.py", line 149, in do_activate
    self.__get__(instance, instance.__class__)()
  File "/usr/lib/python2.7/dist-packages/zim/actions.py", line 132, in func
    self.func(instance, *args, **kwargs)
  File "/home/nick/.local/share/zim/plugins/search_tagged_pages.py", line 132, in search_tagged_pages
    self.progress_bar_fraction = self.index.n_list_all_pages() / 100000.0
AttributeError: 'Index' object has no attribute 'n_list_all_pages'

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.