zim-wiki team mailing list archive
Mailing list archive
new wiki syntax: better way to implement in Zim ?
I worked a couple of hours on Zim code source to deal with a new wiki
syntax Parser / Dumper.
The Dokuwiki syntax (used in Zim) is quite good, but i have tons of
texts written with my own wiki syntax (inspired by other syntaxes - you
can see what it does here -
http://omacronides.com/projets/syntaxe-wiki/) and i wanted to use Zim to
edit / view those texts.
I already have a PHP code that parse and write this kind of syntax, and
i adapted it a bit to support some Zim format features (like headers at
the beginning of a file). So i was at a point where i can edit a zim
notebook with those php tools. The next step was to adapt Zim to be able
to deal with files written with my own wiki syntax.
My PHP Reader / Writer work quite differently than the wiki Parser and
Dumper in Zim ; i didn't try to translate this behavior in python
(maybe I'll do that when i have more than a few hours), so i just took
the native code (zim.formats.wiki.py) and adapt it with a couple of new
So Jaap, my question is : **how can i tell Zim to use my wiki format to
read / write notebook files** ? Well, i understand how to do it, as my
(local) branch of Zim now works with the new wiki syntax ; the real
question is : **which is - in your opinion - the best way to do it** ?
By now, i run Zim with a command line argument, i.e :
The default syntax still 'wiki', and the value is stored in a
WIKI_SYNTAX property in zim module ; next, i clear the 'optsdict' in the
main method if the argument is present, update the WIKI_SYNTAX property
and use it everywhere in the code where there is a call for the format -
i.e. get_format('wiki') became get_format(zim.WIKI_SYNTAX).
I read the related bugs / evolutions in launchpad :
I saw that maybe alternative syntaxes could be a new feature. So, if
you ever think about this evolution, did you think of a way to do it ?
Is my way a valid solution ? Or this feature should be managed in a
plugin, or with a field in the preference dialog ?
As I said, my code is now working, and i could create a branch in
launchpad to share the code once a valuable implementation solution is
Développeur web, rédacteur scientifique
email : rui.nibau@xxxxxxxxxxxxxxx
site : http://omacronides.com
pgp : http://omacronides.com/services/pgp-public-key/
Description: This is a digitally signed message part