← Back to team overview

zim-wiki team mailing list archive

Re: Recursive print/export of sub-pages (determined by sub-links)


Good afternoon,
The proposed solution works, but it doesn't keep an order of pages defined
by +relative links, which is quite important for my use case. So there is
attached a custom script, which generates and stores text to clipboard
(preserving wiki syntax) and on demand it also generates table of content
(depending on presence of a page with the same title).

Custom tool
Copy the "export_subpages_to_clipboard.py" to
"/home/username/.local/share/zim/customtools/". Assign an executable flag
to the file.
Create a custom tool with a command:
%n %s
After the button is pushed you get a text in you clipboard, which contains
wiki formatted text including the content of all sub-pages linked through
relative links (+sub-page).
If page title equals to "table of content" or "Table of content", the page
will represent TOC. This may be relevant for an export to HTML (so far it
is still not implemented in html.py), that is going to be a next step.

The output of hierarchically linked pages is illustrated with two

Regards, JK

Attachment: 20120817 141953_Selection.png
Description: PNG image

Attachment: 20120817 141908_Selection.png
Description: PNG image

Attachment: export_subpages_to_clipboard.py
Description: Binary data

Follow ups