HTML export: icons are exported with an absolute path to zim ressource directory instead of being copied when exporting a single page

Bug #893633 reported by Tony Cheneau on 2011-11-22
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description


I run a local version of Zim. By "local", I mean that I did not installed Zim through a distribution package but instead I start zim.py directly from the sources directory. I use Zim version from Bazar (revision number is the 450).

When exporting a single page to HTML, icons are not copied in the same directory as the page. Instead, the HTML code points to the location of the icons in my installation directory.

For example, the wiki text:
[*] test

Would translate into the following HTML code:
<li style="list-style-image: url(file:///home/myuser/sources/zim/data/pixmaps/checked-box.png)">test</li>

I had a quick look at the code, it seems that the icons are copied only when exporting the complete notebook and are not for a single page export. The proper behavior would be to have the icons copied on both type of export.

Thank you for your hard work!


I think I agree.

Though I am interested in the use case for single page export -- I myself only use it for printing pages, in which case the absolute link is fine - so I'm interested to hear how others use it.



Changed in zim:
status: New → Confirmed
importance: Undecided → Low

I have the same issue with latest bzr source.

HTML export can be usefull to show your work on a web server.
If you make little changes to one page, you export this single page and upload it.
In this usecase, you notice the bug.


N8 (kingn8dogg) wrote :

I agree with the stated use case; At work, I use one large notebook. I often need to share a single page with colleagues and I prefer to avoid static methods like email attachments and prefer to use more dynamic methods like exporting html to a web server or network share.

If this is accepted as a bug then I think the fix is a change to exporter.py. Currently when exporting a single page the linker.target_dir is not set. Attached is a possible solution, the only difference is the addition of line 194: "self.linker.target_dir = dir". I am a python novice. I did not write or modify any test cases for this change and only manually tested it on windows running from source.

N8 (kingn8dogg) wrote :

Above I posted a possible solution to the specific bug but another option is a plugin. Two advantages of the plugin:
1) it does not require changing exporter.py
2) it meets my additional requirement for a one button export method (if you typically use the same export settings then the current export wizard has a lot of extra dialogs and clicks).

Attached is the Quick Export plugin.
The plugin is very similar to the print to browser plugin but instead of using the template class it uses the exporter class. This allows for user preferences to configure:
* Format
* Template
* Export Directory
* Resolved Prefix
* Resolve resource links
* Use namespace directory structure

I think this should be fixed directly in exporter. Will have to take a look at your changes to judge if I can merge them as is. Put it on my list.



Fixed in zim 0.61

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

Other bug subscribers

Related blueprints