I have largely overhauled my table plugin with a new format (less boundary cases for better stability, cleaner functions, a bit of documentation).
The problem of preserving Undo information persists. 2013/7/8 Klaus-Dieter Bauer <[email protected]> > 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
Creation-Date: 2013-07-10T16:21:28+02:00
====== Table ======
Created Wednesday 10 July 2013
''{| -------------- ----- ------ -----''
'' Value Error Source ''
'' ============== ===== ====== =====''
'' Volume 35 ų 0.3 ų ''[[CopyEquations]]
'' Lattice Const. 30 Å 0.1 Å ''[[Home]]
'' <r> <r> ''
'' -------------- ----- ------ ----- |}''
''{| | Value Error Source ''
'' | ============== ===== ====== ===== =''
'' | Volume 35 ų 0.3 ų ''[[CopyEquations]]
'' | Lattice Const. 30 Å 0.1 Å ''[[Home]]
'' | save mode 1 2 3 |}''
''{| | Value Error Source ''
'' | ============== ===== ====== =====''
'' | Volume 35 ų 0.3 ų ''[[CopyEquations]]
'' | Lattice Const. 30 Å 0.1 Å ''[[Home]]'' |}''
''{| -------------- | ----- ------ -----''
'' Value | Error Source ''
'' ============== | ===== ====== =====''
'' Volume | 35 ų 0.3 ų ''[[CopyEquations]]
'' Lattice Const. | 30 Å 0.1 Å ''[[Home]]
'' -------------- | ----- ------ ----- |}''
''{| l | rrl | Value Error Source''
'' ============== | ===== | ====== ===== ======''
'' Volume | 35 ų | 0.3 ų ''[[CopyEquations]]
'' Lattice Const. | 30 Å | 0.1 Å ''[[Home]]'' |}''
tabletrix.py
Description: Binary data
_______________________________________________ Mailing list: https://launchpad.net/~zim-wiki Post to : [email protected] Unsubscribe : https://launchpad.net/~zim-wiki More help : https://help.launchpad.net/ListHelp

