On Sat, Aug 1, 2015 at 3:39 AM, Ricordisamoa ricordisamoa@openmailbox.org wrote:
You are right that there are some redundancies in information
representation (because of having to serve multiple needs), but as far as I know, it is mostly around image attributes. If there is anything else specific (beyond image attributes) that is bothering you, can you flag that?
https://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Transclusion_conte... All template parameters are in data-mw but not parsed. Parameters ending up in the 'final' wikitext are parsed separately.
Parsed template parameters require the `addHTMLTemplateParameters` parameter to Parsoid. We are actively discussing how to expose this sort of functionality via the Parsoid API. But it's not strictly required: you can just recursively invoke Parsoid on the template arguments. I'll try to whip up an example of this soon.
I see huge demand for alternative wikignome-style editors. The more
Parsoid's DOM is predictable, concise and documented, the more users you get.
I think Parsoid's DOM is predictable :-) but, can you say more about what prompted you to say that?
For example, to find images I have to search elements where typeof is one of mw:Image, mw:Image/Thumb, mw:Image/Frame, mw:Image/Frameless, then see if it's a figure or a span, and expect either a <figcaption> or data-mw accordingly. Add that the img tag's parent can be <a> or <span>... Instead, this is what I'd expect a proper structure to look like:
The CSS selector `figure, [typeof~="mw:Image"]` will capture all of the image elements. Similarly, `figure > *:last-child, [typeof~="mw:Image"] > *:last-child` will always capture the caption element (more or less). The structure is actually pretty locked down. (And my mwparserfromhell clone has some image-related helpers to make it even easier.)
Part of the problem here is that media-related markup in wikitext is quite fiendishly complicated, with lots of interlocking parts. The presence of one sort of option can completely change the meaning of others. The Parsoid DOM is designed to try to simplify this complexity, rather than directly mirror the wikitext craziness. --scott