← Back to team overview

zim-wiki team mailing list archive

How to export attachments in zim wiki export, and one bug.

 

Hello,


I have one question.  I lately upgraded zim to version 0.62 and
noticed that the export templating is different.  It took me some time
to put it in work, but one thing is not working at all, attachments.
I use following code to render attachments and my problem is it
generates "local" uri instead of web.  It means that the uri(file) is
like "file:///home/radek/tmp/zim-radek-public/Public/Software/Typesetting/Groff/groff-book.pdf"

            [% IF page.attachments %]
            <br>Attachments:</br>
            <br>Links are broken!</br>
            <table>
                [%- FOR file IN page.attachments -%]
                    <tr>
                        <td><a href='[% uri(file) %]'>[% file.basename
%]</a></td>
                        <td>&nbsp;|&nbsp;</td>
                        <td>[% file.size %]</td>
                        <td>&nbsp;|&nbsp;</td>
                        <td>[% file.mtime %]</td>
                        <td>&nbsp;|&nbsp;</td>
                        <td>([% file %])</td>
                    </tr>
                [%- END -%]
            </table>
            [% END %]

I look through the documentation, which is sparse.  And did not find any help.


Next thing I noticed that ZIM do not like, if I wrote:

'''
'''

When I press save before entering the code in between the ''' it shows
dialog saying:

Could not save page: Public:Programming:Building Compiler Easy:030
Program Template in C

'NoneType' object has no attribute 'insert'

To continue, you can save a copy of this page or discard
any changes. If you save a copy, changes will also be
discarded, but you can restore the copy later.



-- 
Radek


Follow ups