Difference between revisions of "Extension:Contributorlist"
(The code of the contributorlist is by Andreas Plank, most of this documentation as well (with additions by Gregor Hagedorn). Page moved from test wiki to here) |
m (Andreas Plank moved page Parser function: contributorlist to Extension:Contributorlist without leaving a redirect: Parser function: contributorlist → Extension:Contributorlist) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | To obtain a list of contributors for a wiki page the parser function <code><nowiki>{{#contributorlist: }}</nowiki></code> may be used. The results are alphabetical by last name<ref>“last name” for sorting purposes is difficult to unambiguously define across all cultures. Here it is defined as: the last whitespace-separated word in the first part of the string prior to any brackets or commas. Example (word recognized as last name in bold): “John M. '''Smith-Wesson''' (Ph.D.)”, “'''Smith-Wesson''', John M.”, Roberta Morido '''Castellan'''. Note that the last example may be a case of erroneous sorting, which is difficult to automate.</ref> Here are some examples: | + | To obtain a list of contributors for a wiki page the parser function <code><nowiki>{{#contributorlist: }}</nowiki></code> or <code><nowiki>{{#linkedcontributorlist: }}</nowiki></code> may be used. Both functions working in the same way except that the latter links to contributor’s user page. The results are alphabetical by last name<ref>“last name” for sorting purposes is difficult to unambiguously define across all cultures. Here it is defined as: the last whitespace-separated word in the first part of the string prior to any brackets or commas. Example (word recognized as last name in bold): “John M. '''Smith-Wesson''' (Ph.D.)”, “'''Smith-Wesson''', John M.”, Roberta Morido '''Castellan'''. Note that the last example may be a case of erroneous sorting, which is difficult to automate.</ref> Here are some examples: |
<nowiki>{{#contributorlist: }}</nowiki> (default: current page, all contributors separated by comma) | <nowiki>{{#contributorlist: }}</nowiki> (default: current page, all contributors separated by comma) | ||
produces for this page: {{#contributorlist: }} | produces for this page: {{#contributorlist: }} | ||
− | <nowiki>{{#contributorlist: | + | <nowiki>{{#contributorlist: Help:SemanticMW }}</nowiki> with an explicit page name |
− | produces: {{#contributorlist: | + | produces: {{#contributorlist: Help:SemanticMW }} |
− | <nowiki>{{#contributorlist: | + | <nowiki>{{#contributorlist: Help:SemanticMW | 3 }}</nowiki> starting with the 3rd contributor |
− | produces: {{#contributorlist: | + | produces: {{#contributorlist: Help:SemanticMW | 3 }} |
− | <nowiki>{{#contributorlist: | + | <nowiki>{{#contributorlist: Help:SemanticMW | 2 | 4 }}</nowiki> (2nd to 4th contributor) |
− | produces: {{#contributorlist: | + | produces: {{#contributorlist: Help:SemanticMW | 2 | 4 }} |
It is also possible to use a different delimiter (for example “;” or “/”): | It is also possible to use a different delimiter (for example “;” or “/”): | ||
− | <nowiki>{{#contributorlist: | + | <nowiki>{{#contributorlist: Help:SemanticMW | 1 | 30 | &nbsp;/ }}</nowiki> contributors 1-30 separated by a slash “/” |
− | produces: {{#contributorlist: | + | produces: {{#contributorlist: Help:SemanticMW | 1 | 30 | / }}<br/>Note that white space is always trimmed, so one may have to use &nbsp; for non-breaking space or &#32; for normal space. |
Finally we can also use line breaks in the delimiter: | Finally we can also use line breaks in the delimiter: | ||
− | <nowiki>{{#contributorlist: | + | <nowiki>{{#contributorlist: Help:SemanticMW | 1 | 30 | <br/> }}</nowiki> |
− | produces: {{#contributorlist: | + | produces: {{#contributorlist: Help:SemanticMW | 1 | 30 | <br/> }} |
+ | Linking to the contributor’s user page is possible in the same way (having the same features as above): | ||
+ | <nowiki>{{#linkedcontributorlist: Help:SemanticMW }}</nowiki> | ||
+ | produces: {{#linkedcontributorlist: Help:SemanticMW }} | ||
'''Footnotes''' | '''Footnotes''' |
Latest revision as of 11:00, 17 February 2016
To obtain a list of contributors for a wiki page the parser function {{#contributorlist: }}
or {{#linkedcontributorlist: }}
may be used. Both functions working in the same way except that the latter links to contributor’s user page. The results are alphabetical by last name[1] Here are some examples:
{{#contributorlist: }} (default: current page, all contributors separated by comma)
produces for this page: Gregor Hagedorn, Andreas Plank
{{#contributorlist: Help:SemanticMW }} with an explicit page name
produces: Andreas Plank, Lia Veja, Gisela Weber, Bernhard Zelazny
{{#contributorlist: Help:SemanticMW | 3 }} starting with the 3rd contributor
produces: Gisela Weber, Bernhard Zelazny
{{#contributorlist: Help:SemanticMW | 2 | 4 }} (2nd to 4th contributor)
produces: Lia Veja, Gisela Weber, Bernhard Zelazny
It is also possible to use a different delimiter (for example “;” or “/”):
{{#contributorlist: Help:SemanticMW | 1 | 30 | / }} contributors 1-30 separated by a slash “/”
produces: Andreas Plank / Lia Veja / Gisela Weber / Bernhard Zelazny
Note that white space is always trimmed, so one may have to use for non-breaking space or   for normal space.
Finally we can also use line breaks in the delimiter:
{{#contributorlist: Help:SemanticMW | 1 | 30 | <br/> }}
produces: Andreas Plank
Lia Veja
Gisela Weber
Bernhard Zelazny
Linking to the contributor’s user page is possible in the same way (having the same features as above):
{{#linkedcontributorlist: Help:SemanticMW }}
produces: Andreas Plank, Lia Veja, Gisela Weber, Bernhard Zelazny
Footnotes
- ↑ “last name” for sorting purposes is difficult to unambiguously define across all cultures. Here it is defined as: the last whitespace-separated word in the first part of the string prior to any brackets or commas. Example (word recognized as last name in bold): “John M. Smith-Wesson (Ph.D.)”, “Smith-Wesson, John M.”, Roberta Morido Castellan. Note that the last example may be a case of erroneous sorting, which is difficult to automate.