General Principle of the DOM Tree
DOM Tree is not format. It means that we cannot find a flat file with the DOM Tree. It is only an ínternal representation of the data using a tree. Then the Tree can be stored in a database, in a flat file ...
This tree is a collection of item with hierarchical representation. An item can be itself a subtree.
Then to create a document, the principle is pretty simple, we parse the document and construct our tree using such function addNode(), addSiblings() ... And to display a document, we can just browse the tree and convert any item into correct code for the format we choose.
DOM Tree and MoinMoin
In Moin2.0 you are not creating page, but item, then a page is just an item itself including other items.
Main Components to deal with a DOM Tree in MoinMoin
EmeraldTree
EmeraldTree il a fork from ElementTree. It is used to handle our Tree. So in our case, an Element is an item of our Tree.
MoinMoin.Converter2
Converter2 are the set of converter form and to the DOM Tree
MoinMoin.util.tree
This class is used to handle the NameSpace. However that's not so clear what is a namespace exactly.
MoinMoin.util.mime
This class handle the different mimetype for our object in the tree.
Quick Reminder about the converter
Check BastianBlank/TreeOutputFormatter/Documentation for more information. But here are some key point you have to remember when you start a to write a converter.
The entry point is call and element is a node of the DOM Tree.
- The converter object should be re register to the converter registry.
Question
- Why do the converters have all a _Iter and _Stack class ?
What does _TableArguments class in moinwiki_in ? Especially the big regex is not really clear.
The converter is called with call function, however, I do not know if this function is called for any element of the Tree or only for the root element. (It seems that it is called for any element, since I do not see any tree browsing code in html_out converter).