[fpc-devel] fpdoc content syntax suggestion
sergei_gorelkin at mail.ru
Sat Jul 10 22:16:22 CEST 2010
Marco van de Voort wrote:
> I don't understand this, since if I follow these steps, the stored nodes
> still may contain the wiki syntax, and thus need backend changes?
> Or am I wrong and are you suggesting encoding the xml/html to wiki as much as
> possible before editing, and decoding it to xml/html tags afterwards?
> IOW what is the storage format?
The storage format may be called "XML with wiki-formatted textnodes". We keep XML elements for
general structure, and optionally use wiki syntax for HTML formatting.
As an example, you type:
<element name='foo'>some *bold* text</element>
When loading it with fpdoc, first the xml parser parses this and creates an element with a textnode.
Then it passes content of text node ('some *bold* text') to wiki-or-whatever parser. That parser, in
turn, recognizes 'bold' and creates another DOM element:
some <b>bold</b> text
This stuff replaces the content of 'element' tag in the original XML.
At this point, if you save the DOM tree, you'll lose all wiki markup and get pure XML.
Of course, you may edit with tags as much as you wish. If the original example already contains
<element name='foo'>some <b>bold</b> text</element>
then the wiki parser will be called 3 times (for 'some ', 'bold' and ' text'), but that will be
effectively a no-op.
More information about the fpc-devel