Template:Uses from: Difference between revisions

Tweak to have {{{1}}} identify whether it's a library (or implementation, or whatever).
m (Whoops. Started sGML comment block incorrectly.)
(Tweak to have {{{1}}} identify whether it's a library (or implementation, or whatever).)
 
Line 1:
<div class="examplemeta libheader"><noinclude>'''Uses:''' (librarytool name) <small> ('''Component[s]:''' Component1, Component2, ComponentN )</small></noinclude><includeonly>'''Uses:''' [[SMW::off]]<!--
 
-->[[uses::Library/{{{1}}}/{{{2}}}|{{{12}}}]]<!--
-->{{#set:Uses library{{{1}}}=Library/{{{1}}}/{{{2}}}}}<!--
 
-->[[Category:{{{12}}}]]<!--
 
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.
Line 25:
-->[[SMW::on]]<!--
 
-->[[Uses library{{{1}}}::Library/{{{1}}}/{{{2}}}/{{{component$n$}}}|{{{component$n$}}}]], <!--
 
Ending #foreach
Line 43:
--><noinclude>
 
This template is intended to handle the case where a library{{{1}}} has many components within it (examples of this include CPAN, RubyGems and Tcllib). It has two required parameters: <tt><nowiki>{{</nowiki>uses from|</tt>''library{{{1}}}''<tt>|</tt>''component''<tt><nowiki>}}</nowiki></tt>. The ''library{{{1}}}'' is the name of the overall library{{{1}}} of components (which should also be the name of a category here on RC) and the ''component'' is the name of the component within it (which can be almost any string).
 
==Discussion==
Line 49:
 
===What it does===
* Associates the page with the library{{{1}}}:
** Semantically, as <tt><nowiki>[[Uses library{{{1}}}::{{{12}}}]</nowiki></tt>
** As part of <tt>[[:Category:{{{12}}}]]</tt> (though this may eventually change)
** By linking to <tt>[[Library/{{{1}}}/{{{2}}}]]</tt>.
* Associates the page with each component specified
** Semantically, as <tt><nowiki>[[Uses library{{{1}}}::{{{12}}}/{{{componentN}}}]]</nowiki></tt> (Placing the component as a subpage of the library{{{1}}}
** By linking to <tt><nowiki>[[Library/{{{1}}}/{{{2}}}/{{{componentN}}}]]</nowiki></tt>.
 
===What it needs to do (eventually)===
* Associate library{{{1}}} version information with the page.
* Associate component version information with the page.