Template:Uses from: Difference between revisions

From Rosetta Code
Content added Content deleted
(Yanked version code for the time being. Rewrote description.)
(Fixed visible preview.)
Line 1: Line 1:
<div class="examplemeta libheader">'''Uses:''' [[SMW::off]]<!--
<div class="examplemeta libheader"><noinclude>'''Uses:''' (library name) <small> ('''Component[s]:''' Component1, Component2, ComponentN )</small></noinclude><includeonly>'''Uses:''' [[SMW::off]]<!--


-->[[uses::Library/{{{1}}}|{{{1}}}]]<!--
-->[[uses::Library/{{{1}}}|{{{1}}}]]<!--
Line 20: Line 20:
End plural/singluar #if.
End plural/singluar #if.
-->}}<!--
-->}}<!--

includeonly the foreach loop.
--><includeonly><!--


-->{{#foreach: component$n$|<!--
-->{{#foreach: component$n$|<!--
Line 37: Line 34:


Ending examplemeta div.
Ending examplemeta div.
--></includeonly>)</small></div><!--
--> )</small></includeonly></div><!--


--><noinclude>
--><noinclude>

Revision as of 02:55, 20 November 2010

Uses: (library name) (Component[s]: Component1, Component2, ComponentN )

This template is intended to handle the case where a library has many components within it (examples of this include CPAN, RubyGems and Tcllib). It has two required parameters: {{uses from|library|component}}. The library is the name of the overall library 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

This template is derived from {{tcllib}}, and seeks to have a similar aim, except more generically, and as a potential eventual replacement for {{libheader}} and {{works with}}. (And {{tcllib}}, if it achieves sufficient functionality.)

What it does

  • Associates the page with the library:
    • Semantically, as [[Uses library::{{{1}}}]
    • As part of [[:Category:{{{1}}}]] (though this may eventually change)
    • By linking to [[Library/{{{1}}}]].
  • Associates the page with each component specified
    • Semantically, as [[Uses library::{{{1}}}/{{{componentN}}}]] (Placing the component as a subpage of the library
    • By linking to [[Library/{{{1}}}/{{{componentN}}}]].

What it needs to do (eventually)

  • Associate library version information with the page.
  • Associate component version information with the page.

What it should do

  • Avoid using MediaWiki categories as possible.

The richer the relationships we can define, the more powerful the search options we'll have available.



This is a template. There are many others. See Category:RCTemplates for a complete list of templates.