MediaWiki templates: Difference between revisions
Fabrice P. Laussy's Web
Fabrice (talk | contribs)
mNo edit summary
 
(68 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This is a list of '''templates''' we use for [[MediaWiki]]. They can generally be accessed through this website (http://laussy.org) by entering <tt>Template:NameOfTemplate</tt> as the last part of the url.
= Templates used on this site =


= List =
This is a list of '''templates''' we use for [[MediaWiki]]. They can generally be accessed through this website (http://laussy.org) by entering <tt>Template:NameOfTemplate</tt> as the last part of the URL.


== contact me ==
Arguments are passed to template with <tt><nowiki>{{{1}}}</nowiki></tt> (2, 3, etc. for several arguments).
 
== List ==
 
=== anchor ===
 
{{anchor|anchorforanchor}}<tt><nowiki>{{anchor|anchorforanchor}}</nowiki></tt> Puts an anchor to refer to this spot. One can then refer to <nowiki>[[#anchorforanchor|the anchor]]</nowiki> [[#anchorforanchor|the anchor]] like this within the same page or <nowiki>[[Blog:Sandbox/buggy#anchorforanchor|for another page]]</nowiki> [[Blog:Sandbox/buggy#anchorforanchor|for another page]].
 
=== arXiv ===
 
{{arXiv|2402.14010}} <tt><nowiki>{{arXiv|2402.14010}}</nowiki></tt> gives a link to an arXiv reference. Ideally it should retrieve meta-data, but that is for later.
 
=== cite ===
 
A cite template to quote in a way similar as you would do with $\mathrm{\TeX}$ and bibTeX is described [[Blog:Hacks/A_simple_way_to_quote_from_bibTeX_in_MediaWiki|in this blog post]].
Can also be done inline with <tt><nowiki>{{onelinecite|delvalle12a}}</nowiki></tt>.
 
=== contactme ===


Puts whatever should read when I need someone to {{contact me}}:
Puts whatever should read when I need someone to {{contact me}}:


<pre>{{contact me}}</pre>
<pre>{{contactme}}</pre>
 
=== crossed ===
 
{{crossed}} signals something not done or not working, maybe with a reason why <nowiki>{{crossed|needs a better image}}</nowiki>{{crossed|needs a better image}}
 
See also <nowiki>{{done}}</nowiki>.
 
=== CustomHeader ===
 
The path to the image must be absolute:
 
<syntaxhighlight lang="mediawiki" class="wrap">
{{CustomHeader
|image=http://localhost/laussywiki/images/
|headertext=Title
|headercolor=#4B371C
|headercolorbackground=rgba(255, 255, 255, 0.66)
|headerposition=top:5px;left:10px;font-size:40px;text-align:left
|blurb=...
|blurbcolor=#4B371C
|blurbcolorbackground=rgba(207, 211, 222, 0.75)
|blurbposition=bottom:20px;right:20px;font-size:large;width:66%;text-align:right}}
</syntaxhighlight>
 
=== doi ===
 
<tt><nowiki>{{doi}}</nowiki></tt> displays the [[DOI]] passed as an argument with a link to the resource itself, e.g., <nowiki>{{doi|10.1002/pssc.200304064}}</nowiki> produces {{doi|10.1002/pssc.200304064}}.
 
=== done ===
 
<tt><nowiki>{{done}}</nowiki></tt> puts a little "checked" marker, like this{{done}}, while <tt><nowiki>{{done|that was great!}}</nowiki></tt> adds a [[wz]]-tooltip{{done|that was great!}}. Or several{{done|really great!}}{{done|and as many as we want}}{{done|quite cool|http://google.com}}. See also <nowiki>{{crossed}}</nowiki>
 
=== gpx ===
 
Offers to "{{gpx|Media:AbedularCanencia-27Oct2013.gpx}}" <tt><nowiki>{{gpx|Media:AbedularCanencia-27Oct2013.gpx}}</nowiki></tt>
 
=== Grok ===
 
This one is funny as it's one I made with [[Grok]] itself (although it couldn't do it wholly by itself):
 
<pre>
{{#vardefine:HumanUserIs|Fabrice}}
 
Pass a custom user input (parameter 1) and Grok's response (parameter 2):
{{Grok|Question|Answer}}
</pre>
 
{{Grok|Question|Answer}}
Note that if <tt>HumanUserIs</tt> not defined, then the interaction is with "Human".
 
=== download ===
 
Puts a logo {{download}}
 
=== fr ===
 
{{fr}}
 
=== indent ===
 
{{multicol}}
<pre>
* This is an example with bullet lists:
{{indent}}
Hi.
{{indent-end}}
* And another one:
{{indent}}
Hi there!
{{indent}}
Hello.
{{indent-end}}
{{indent-end}}
</pre>
{{multicol-break}}
* This is an example with bullet lists:
{{indent}}
Hi.
{{indent-end}}
* And another one:
{{indent}}
Hi there!
{{indent}}
Hello.
{{indent-end}}
{{indent-end}}
{{multicol-end}}
 
<pre>
* This is an example with bullet lists:
{{indent}}Hi.{{indent-end}}
* And another one:
{{indent}}Hi there!{{indent}}Hello.{{indent-end}}{{indent-end}}
</pre>
 
* This is an example with bullet lists:
{{indent}}Hi.{{indent-end}}
* And another one:
{{indent}}Hi there!{{indent}}Hello.{{indent-end}}{{indent-end}}
 
=== ISBN ===
 
<nowiki>{{ISBN|978-0691145075}}</nowiki> {{ISBN|978-0691145075}}
 
=== now ===
 
To capture the time at which the edit is made. It must be substituted:
 
<nowiki>{{subst:now}}</nowiki> 15:16 on {{thisday|4|September|2024}}
 
=== onlinecite ===
 
This makes an inline reference as Ref.&nbsp;{{onlinecite|delvalle12a}} with <tt><nowiki>{{onlinecite|delvalle12a}}</nowiki></tt>
 
=== onlineref ===
 
This makes an inline reference which does not have to be a [[bibTeX]] key, such as Ref.&nbsp;<tt><nowiki>{{onlineref|This does not have to be a [[bibTeX]] key, e.g., {{delvalle12a}}.}}</nowiki></tt>&nbsp;{{onlineref|This does not have to be a [[bibTeX]] key, e.g., {{delvalle12a}}}}
 
=== pdf ===
 
<tt><nowiki>{{pdf}}</nowiki></tt> puts an icon {{pdf}}like this and <tt><nowiki>{{pdf|File:myfile.pdf}}</nowiki></tt> links to it {{pdf|laussy-cv.pdf}}.
 
=== pright ===
 
Inserts a right-aligned paragraph. This is a weak counterpart to ''quote'' but is not a float, so is less fragile.
 
<pre>{{pright|This text.}}</pre>
 
reads {{pright|This text.}}
 
=== quote ===
 
Inserts a quotation. See [[Template:Quote]] for documentation.
 
=== see ===
 
{{see|Fabrice}} <nowiki>{{see|Fabrice}}</nowiki> is pointing on [[Fabrice]] (used with [[pages shortcuts]]).
 
=== sic ===
 
{{sic}} <nowiki>{{sic}}</nowiki> points at (but does not correct) an error.
 
{{sic|err}} <nowiki>{{sic|err}}</nowiki> points at (but does not correct) the error.
 
{{sic|err|should be 'error'!}} <nowiki>{{sic|err|should be 'error'!}}</nowiki> points at and correct the error in tooltip.
 
{{sic||only correction}} <nowiki>{{sic||only correction}}</nowiki> only correct correct the error in tooltip.
 
=== Sleep ===


== stub ==
<tt><nowiki>{{sleep}}</nowiki></tt> marks a sleeping night in a [[campervan]] trip as follows: {{sleep}}.
 
=== stretch ===
 
Give the distance and/or time between two localizations, such as <tt><nowiki>[[Tres Cantos]]{{stretch|20min (22.3km)}}[[Soto del Real]]</nowiki></tt>[[Tres Cantos]]{{stretch|20min (22.3km)}}[[Soto del Real]]. It can also take two arguments, in which case it separates them with a comma. We use it to plan trips.
 
=== stub ===


Warns of pages that are still so much in construction, they're not really nice to visit.
Warns of pages that are still so much in construction, they're not really nice to visit.
Line 17: Line 189:
{{stub}}
{{stub}}


== thisday ==
=== TeX ===
 
{{TeX}}
 
=== thisday ===


Provides the clickable date of a given day, e.g.,
Provides the clickable date of a given day, e.g.,


<pre>{{subst:thisday|30|September|1977}}</pre>
<nowiki>{{thisday|30|September|1977}}</nowiki> {{thisday|30|September|1977}}


gives [[30 September|30]] [[September (1977)|September]] [[1977|(1977)]]. See also ''today''.
See also <nowiki>{{thesedays}}</nowiki>.


== today ==
=== thesedays ===


Provides the clickable date of today, e.g.,
This can take 4 or 5 arguments, and the final argument (year) can be left empty in which case it is not displayed:
 
<nowiki>{{thesedays|15|June|15|July|2024}}</nowiki> {{thesedays|15|June|15|July|2024}}
 
<nowiki>{{thesedays|15|June|15|July|}}</nowiki> {{thesedays|15|June|15|July|}}
 
<nowiki>{{thesedays|15|17|July|2024}}</nowiki> {{thesedays|15|17|July|2024}}
 
<nowiki>{{thesedays|15|17|July|}}</nowiki> {{thesedays|15|17|July|}}
 
If the years are different, then two <nowiki>{{thisday}}</nowiki> calls should be made (and maybe a † has to be featured somewhere?!)
 
=== today ===
 
To be used with "subst:" to provide the clickable date of today, e.g.,


<pre>{{subst:today}}</pre>
<pre>{{subst:today}}</pre>


gives [[15 November|15]], [[November (2009)|November]]&nbsp;[[2009|(2009)]].
gives {{thisday|31|December|2023}}.
 
=== update ===
 
Indicates an {{update}} <nowiki>{{update}}</nowiki> possibly with a date {{update|16 July 2023}} <nowiki>{{update|16 July 2023}}</nowiki>.
 
=== hour ===
 
Gives the local hour (shortcut for <nowiki>{{LOCALTIME}}</nowiki> or <nowiki>{{CURRENTIME}}</nowiki>; still have to fix timezone issue), e.g.,
 
<pre>{{hour}}</pre>
 
gives {{hour}}.
 
=== multicol ===
 
From [http://en.wikipedia.org/w/index.php?title=Template:Multicol Wikipedia's multicol]. Use as:
 
<pre>
{{multicol}}
This text appears in the first column.
{{multicol-break}}
This text appears in the second column.
{{multicol-break}}
This text appears in the third column.
{{multicol-end}}
</pre>
 
to read:
 
{{Multicol}}
This text appears in the first column.
{{Multicol-break}}
This text appears in the second column.
{{Multicol-break}}
This text appears in the third column.
{{Multicol-end}}
 
<pre><nowiki>
You need to create the three corresponding pages<wz tip="Template:Multicol, Template:Multicol-break and Template:Multicol-end.">$^*$</wz>, which are shortcuts for divivision of the page with floats.
<nowiki></pre>
 
=== wl1, wl2, wl3 ===
 
For [[featured articles]].
 
#<pre><nowiki>{{wl1}}</nowiki></pre> is to be put on stubby articles in progress (all of them).  
#<pre><nowiki>{{wl2}}</nowiki></pre> is to be put on good & interesting articles that could/should be improved but remain okay in their present state.
#<pre><nowiki>{{wl3}}</nowiki></pre> is to identify great content, that we are proud of.
 
== References ==
<references />

Latest revision as of 17:02, 6 July 2025

Templates used on this site

This is a list of templates we use for MediaWiki. They can generally be accessed through this website (http://laussy.org) by entering Template:NameOfTemplate as the last part of the URL.

Arguments are passed to template with {{{1}}} (2, 3, etc. for several arguments).

List

anchor

{{anchor|anchorforanchor}} Puts an anchor to refer to this spot. One can then refer to [[#anchorforanchor|the anchor]] the anchor like this within the same page or [[Blog:Sandbox/buggy#anchorforanchor|for another page]] for another page.

arXiv

arXiv:2402.14010 {{arXiv|2402.14010}} gives a link to an arXiv reference. Ideally it should retrieve meta-data, but that is for later.

cite

A cite template to quote in a way similar as you would do with $\mathrm{\TeX}$ and bibTeX is described in this blog post. Can also be done inline with {{onelinecite|delvalle12a}}.

contactme

Puts whatever should read when I need someone to contact me:

{{contactme}}

crossed

signals something not done or not working, maybe with a reason why {{crossed|needs a better image}}needs a better image

See also {{done}}.

CustomHeader

The path to the image must be absolute:

{{CustomHeader
|image=http://localhost/laussywiki/images/
|headertext=Title
|headercolor=#4B371C
|headercolorbackground=rgba(255, 255, 255, 0.66)
|headerposition=top:5px;left:10px;font-size:40px;text-align:left
|blurb=...
|blurbcolor=#4B371C
|blurbcolorbackground=rgba(207, 211, 222, 0.75)
|blurbposition=bottom:20px;right:20px;font-size:large;width:66%;text-align:right}}

doi

{{doi}} displays the DOI passed as an argument with a link to the resource itself, e.g., {{doi|10.1002/pssc.200304064}} produces [DOI: 10.1002/pssc.200304064].

done

{{done}} puts a little "checked" marker, like this, while {{done|that was great!}} adds a wz-tooltipthat was great!. Or severalreally great!and as many as we wantquite cool. See also {{crossed}}

gpx

Offers to "Download the gpx file for this track." {{gpx|Media:AbedularCanencia-27Oct2013.gpx}}

Grok

This one is funny as it's one I made with Grok itself (although it couldn't do it wholly by itself):

{{#vardefine:HumanUserIs|Fabrice}}

Pass a custom user input (parameter 1) and Grok's response (parameter 2):
{{Grok|Question|Answer}}

Human: Question

rok: Answer

Note that if HumanUserIs not defined, then the interaction is with "Human".

download

Puts a logo

fr

indent

* This is an example with bullet lists:
{{indent}}
Hi.
{{indent-end}}
* And another one:
{{indent}}
Hi there!
{{indent}}
Hello.
{{indent-end}}
{{indent-end}}
  • This is an example with bullet lists:

Hi.

  • And another one:

Hi there!

Hello.

* This is an example with bullet lists:
{{indent}}Hi.{{indent-end}}
* And another one:
{{indent}}Hi there!{{indent}}Hello.{{indent-end}}{{indent-end}}
  • This is an example with bullet lists:
Hi.
  • And another one:
Hi there!
Hello.

ISBN

{{ISBN|978-0691145075}} [ISBN: 978-0691145075]

now

To capture the time at which the edit is made. It must be substituted:

{{subst:now}} 15:16 on 4 September (2024)

onlinecite

This makes an inline reference as Ref. [1] with {{onlinecite|delvalle12a}}

onlineref

This makes an inline reference which does not have to be a bibTeX key, such as Ref. {{onlineref|This does not have to be a [[bibTeX]] key, e.g., {{delvalle12a}}.}} [2]

pdf

{{pdf}} puts an icon like this and {{pdf|File:myfile.pdf}} links to it .

pright

Inserts a right-aligned paragraph. This is a weak counterpart to quote but is not a float, so is less fragile.

{{pright|This text.}}

reads

This text.

quote

Inserts a quotation. See Template:Quote for documentation.

see

{{see|Fabrice}} is pointing on Fabrice (used with pages shortcuts).

sic

[sic] {{sic}} points at (but does not correct) an error.

err [sic] {{sic|err}} points at (but does not correct) the error.

err [sic]should be 'error'! {{sic|err|should be 'error'!}} points at and correct the error in tooltip.

[sic]only correction {{sic||only correction}} only correct correct the error in tooltip.

Sleep

{{sleep}} marks a sleeping night in a campervan trip as follows:  .

stretch

Give the distance and/or time between two localizations, such as [[Tres Cantos]]{{stretch|20min (22.3km)}}[[Soto del Real]]Tres Cantos20min (22.3km)Soto del Real. It can also take two arguments, in which case it separates them with a comma. We use it to plan trips.

stub

Warns of pages that are still so much in construction, they're not really nice to visit.

{{stub}}

This page is still largely in progress.

TeX

$\mathrm{\TeX}$

thisday

Provides the clickable date of a given day, e.g.,

{{thisday|30|September|1977}} 30 September (1977)

See also {{thesedays}}.

thesedays

This can take 4 or 5 arguments, and the final argument (year) can be left empty in which case it is not displayed:

{{thesedays|15|June|15|July|2024}} 15 June15 July (2024)

{{thesedays|15|June|15|July|}} 15 June15 July

{{thesedays|15|17|July|2024}} 1517 July (2024)

{{thesedays|15|17|July|}} 1517 July

If the years are different, then two {{thisday}} calls should be made (and maybe a † has to be featured somewhere?!)

today

To be used with "subst:" to provide the clickable date of today, e.g.,

{{subst:today}}

gives 31 December (2023).

update

Indicates an {{update}} possibly with a date 16 July 2023 {{update|16 July 2023}}.

hour

Gives the local hour (shortcut for {{LOCALTIME}} or {{CURRENTIME}}; still have to fix timezone issue), e.g.,

{{hour}}

gives {{subst:LOCALTIME}}.

multicol

From Wikipedia's multicol. Use as:

{{multicol}}
This text appears in the first column.
{{multicol-break}}
This text appears in the second column.
{{multicol-break}}
This text appears in the third column.
{{multicol-end}}

to read:

This text appears in the first column.

This text appears in the second column.

This text appears in the third column.

<nowiki>
You need to create the three corresponding pages<wz tip="Template:Multicol, Template:Multicol-break and Template:Multicol-end.">$^*$</wz>, which are shortcuts for divivision of the page with floats.
<nowiki>

wl1, wl2, wl3

For featured articles.

  1. {{wl1}}
    is to be put on stubby articles in progress (all of them).
  2. {{wl2}}
    is to be put on good & interesting articles that could/should be improved but remain okay in their present state.
  3. {{wl3}}
    is to identify great content, that we are proud of.

References