Hello! I have written a make-shift table plugin, that just helps managing tables made from verbatim text (though images and links are possible, but currently break the formatting). Basically it looks for a line starting with {{| and the earliest line afterwards ending with ||} and realigns table contents in between.
However, I found this extremely difficult to do on the level of the parsetree and instead extract the source code through "page.dump(zim.formats.wiki)", modify the source and write it back with "page.parse(...)". Sadly though, afterwards Undo is not possible. Is there some way that I can modify the contents of a page without breaking Undo? I have attached the experimental source and a file with example tables for reference. (Note: High risk of data loss, it's still pretty buggy). kind regards, Klaus
Content-Type: text/x-zim-wiki Wiki-Format: zim 0.4 ====== TableCopy ====== Created Monday 08 July 2013 {{| lrrl '' | Value Error Source'' ''============== | ====== ====== ==========='' ''Volume | 35 ų 0.3 ų ''[[Copy]]''E''[[quations]] ''Lattice Const. | 30 Š0.1 Š''[[Home]] |}} ''{{| l|rrl | Value Error Source'' ''======= | ====== ====== ==========='' ''Volume | 35 ų 0.3 ų ''[[Copy]]''E''[[quations]] ''Lattice Const. | 30 Š0.1 Š''[[Home]] ''|}}'' ''{{| ||l|rr||l| | Value Error Source'' ''============== | === ====== ==========='' [[Table|TableLongerName]] ''Volume | 35 ų 0.3 ų ''[[Copy]]''E''[[quations]] ''Lattice Const. | 30 Š0.1 Š''[[Home]] ''|}}'' Hallo Welt
tabletrix.py
Description: Binary data
_______________________________________________ Mailing list: https://launchpad.net/~zim-wiki Post to : zim-wiki@lists.launchpad.net Unsubscribe : https://launchpad.net/~zim-wiki More help : https://help.launchpad.net/ListHelp