On 12-02-02 9:38 AM, Gabriel Wicke wrote:
[...]

Both are custom solutions for internal use. For an external interface, a
standardized solution would be preferable. HTML5 microdata [2] seems to
fit our needs quite well.

Assuming a template that expands to a div and some content, this would
be represented like this:

<div itemscope
    itemtype='http://en.wikipedia.org/wiki/Template:Sometemplate' >
    <h2>A static header from the template</h2>
    <!-- The template argument 'name', expanded in the template -->
    <p itemprop='name' content='The wikitext name'>The rendered name</p>
</div>

In this case, an expanded template argument within (for example) an
infobox is identified inside the template-provided HTML structure, which
could enable in-place editing.

Unused arguments (which are not found in the template expansion) or
unexpanded templates can be represented using non-displaying meta elements:

<div itemscope
    itemtype='http://en.wikipedia.org/wiki/Template:Sometemplate'
    id='uid-1' >
    <h2>A static header from the template</h2>
    <!-- The template argument 'name', expanded in the template -->
    <p itemprop='name' content='The wikitext name'>The rendered name</p>
    <meta itemprop='firstname' content='The wikitext firstname'>
</div>

The itemref mechanism can be used to tie together template data from a
single template that does not expand to a single subtree:

<div itemscope itemref='uid-1'>
  <!-- Some more template output from expansion of
http://en.wikipedia.org/wiki/Template:Sometemplate -->
</div>
I'm tempted to say that rather than the template being the itemtype we should have a proper itemtype.
<div itemscope itemtype=' http://www.mediawiki.org/microdata/wikitext/Transclusion">
  <meta itemprop="PageTitle" content="Template:Sometemplate">
  [...]
</div>

[...]

What do you think about these ideas?

Gabriel

References:
[1]: http://www.mediawiki.org/wiki/Future/Parser_development
[2]:
http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html
[3]:
http://support.google.com/webmasters/bin/answer.py?hl=en&answer=99170&topic=21997&ctx=topic

This text is on the wiki at
http://www.mediawiki.org/wiki/Future/HTML5_DOM_with_microdata
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]