[...]
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.