Template:Uses from: Difference between revisions
Tweak to have {{{1}}} identify whether it's a library (or implementation, or whatever).
(Ok, I think that handles the simple case of multiple component listings. No versions yet.) |
(Tweak to have {{{1}}} identify whether it's a library (or implementation, or whatever).) |
||
(26 intermediate revisions by the same user not shown) | |||
Line 1:
<div class="examplemeta libheader"><noinclude>'''Uses:''' (tool name) <small> ('''Component[s]:''' Component1, Component2, ComponentN )</small></noinclude><includeonly>'''Uses:''' [[SMW::off]]<!--
-->[[
▲-->{{#set:Uses library={{{1}}}}}<!--
There must be a component N=1, for there to be a component N>1. If there's no component N=1, then there's no reason to put any of the component list artifacts in.
-->{{#if: {{{component1|}}}|<!--
▲-->[[Category:{{{1}}}]][[SMW::on]]<!--
Is there more than one component?
-->{{#if: {{{component2}}}|<!--
Plural
-->'''Components:''' <!--
-->|<!--
Singular
End plural/singluar #if.
-->}}<!--
-->{{#foreach: component$n$|<!--
▲--> <small>('''Component[s]:''' {{{2}}})<!--
-->[[SMW::on]]<!--
-->}}<!--
Ending #if componentN
▲-->{{Uses {{{1}}} package::component$n$|component$n$}}<!--
-->}}<!--
Only apply </small> if we have components.
▲-->}}</small><!--
-->{{#if: {{{component1|}}}|<!--
--> )</small> <!--
-->}}<!--
Ending examplemeta div.
--></includeonly></div><!--
--><noinclude>
This template is intended to handle the case where a
==Discussion==
This template is derived from {{tmpl|tcllib}}, and seeks to have a similar aim, except more generically, and as a potential eventual replacement for {{tmpl|libheader}} and {{tmpl|works with}}. (And {{tmpl|tcllib}}, if it achieves sufficient functionality.)
===What it does===
* Associates the page with the {{{1}}}:
** Semantically, as <tt><nowiki>[[Uses {{{1}}}::{{{2}}}]</nowiki></tt>
** As part of <tt>[[:Category:{{{2}}}]]</tt> (though this may eventually change)
** By linking to <tt>[[{{{1}}}/{{{2}}}]]</tt>.
* Associates the page with each component specified
** Semantically, as <tt><nowiki>[[Uses {{{1}}}::{{{2}}}/{{{componentN}}}]]</nowiki></tt> (Placing the component as a subpage of the {{{1}}}
** By linking to <tt><nowiki>[[{{{1}}}/{{{2}}}/{{{componentN}}}]]</nowiki></tt>.
===What it needs to do (eventually)===
* Associate {{{1}}} version information with the page.
* Associate component version information with the page.
===What it should do===
The richer the relationships we can define, the more powerful the search options we'll have available.▼
* Avoid using MediaWiki categories as possible.
▲The richer the relationships we can define, the more powerful the search options we'll have available.
{{template}}[[Category:Example description templates]]</noinclude>
|