Template:Source: Difference between revisions
Template page
More actions
Wiki lane: site structure (templates, forms, help pages) |
Wiki lane: site structure (templates, forms, help pages) |
||
| Line 1: | Line 1: | ||
<includeonly><templatestyles src="Infobox/styles.css" /><span class="cmpw-source">Source: {{#if:{{{link|{{{3|}}}}}}|[{{{link|{{{3|}}}}}} @{{#replace:{{{handle|{{{1|}}}}}}|@|}}]|@{{#replace:{{{handle|{{{1|}}}}}}|@|}}}}{{#if:{{{date|{{{2|}}}}}}|, {{{date|{{{2|}}}}}}}}</span></includeonly><noinclude><templatestyles src="Infobox/styles.css" /> | <includeonly><templatestyles src="Infobox/styles.css" /><span class="cmpw-source">Source: {{#if:{{{repo|}}}|repo [{{{repo}}} {{#replace:{{#replace:{{{repo}}}|https://|}}|http://|}}] by {{#explode:{{{repo}}}|/|3}} on {{#switch:{{lc:{{#explode:{{{repo}}}|/|2}}}}|github.com|www.github.com=GitHub|#default={{#explode:{{{repo}}}|/|2}}}}{{#if:{{{handle|{{{1|}}}}}}|, posted by }}}}{{#if:{{{handle|{{{1|}}}}}}|{{#if:{{{link|{{{3|}}}}}}|[{{{link|{{{3|}}}}}} @{{#replace:{{{handle|{{{1|}}}}}}|@|}}]|@{{#replace:{{{handle|{{{1|}}}}}}|@|}}}}}}{{#if:{{{date|{{{2|}}}}}}|{{#if:{{{handle|{{{1|}}}}}}{{{repo|}}}|, }}{{{date|{{{2|}}}}}}}}{{#if:{{{note|}}}| ({{{note}}})}}</span></includeonly><noinclude><templatestyles src="Infobox/styles.css" /> | ||
Credit line for an imported fact | Credit line for an imported fact. | ||
Parameters (all optional, positional 1 to 3 still work): | |||
* <code>handle</code> (or 1): the Discord handle, with or without @ | |||
* <code>date</code> (or 2): YYYY-MM-DD | |||
* <code>link</code> (or 3): the Discord message link | |||
* <code>note</code>: a short qualifier shown in brackets at the end, for example <code>lab notes</code> or <code>translated</code> | |||
* <code>repo</code>: a repository URL; renders "repo <url> by <owner> on GitHub" (owner read from the URL; other hosts are named by their host), followed by "posted by @handle" when a handle is given | |||
Examples: | |||
* <code><nowiki>{{Source|mountains|2026-10-12|https://discord.com/channels/1/2/3}}</nowiki></code> gives {{Source|mountains|2026-10-12|https://discord.com/channels/1/2/3}} | |||
* <code><nowiki>{{Source|darkmaniac7|2026-10-20|note=lab notes}}</nowiki></code> gives {{Source|darkmaniac7|2026-10-20|note=lab notes}} | |||
* <code><nowiki>{{Source|handle=someone|date=2026-10-15|link=https://discord.com/channels/1/2/4|note=translated}}</nowiki></code> gives {{Source|handle=someone|date=2026-10-15|link=https://discord.com/channels/1/2/4|note=translated}} | |||
* <code><nowiki>{{Source|repo=https://github.com/OWNER/REPO}}</nowiki></code> gives {{Source|repo=https://github.com/OWNER/REPO}} | |||
* <code><nowiki>{{Source|mountains|2026-10-12|https://discord.com/channels/1/2/3|repo=https://github.com/OWNER/REPO}}</nowiki></code> gives {{Source|mountains|2026-10-12|https://discord.com/channels/1/2/3|repo=https://github.com/OWNER/REPO}} | |||
[[Category:Templates]]</noinclude> | [[Category:Templates]]</noinclude> | ||
Latest revision as of 07:49, 30 October 2026
Credit line for an imported fact.
Parameters (all optional, positional 1 to 3 still work):
handle(or 1): the Discord handle, with or without @date(or 2): YYYY-MM-DDlink(or 3): the Discord message linknote: a short qualifier shown in brackets at the end, for examplelab notesortranslatedrepo: a repository URL; renders "repo <url> by <owner> on GitHub" (owner read from the URL; other hosts are named by their host), followed by "posted by @handle" when a handle is given
Examples:
{{Source|mountains|2026-10-12|https://discord.com/channels/1/2/3}}gives Source: @mountains, 2026-10-12{{Source|darkmaniac7|2026-10-20|note=lab notes}}gives Source: @darkmaniac7, 2026-10-20 (lab notes){{Source|handle=someone|date=2026-10-15|link=https://discord.com/channels/1/2/4|note=translated}}gives Source: @someone, 2026-10-15 (translated){{Source|repo=https://github.com/OWNER/REPO}}gives Source: repo github.com/OWNER/REPO by OWNER on GitHub{{Source|mountains|2026-10-12|https://discord.com/channels/1/2/3|repo=https://github.com/OWNER/REPO}}gives Source: repo github.com/OWNER/REPO by OWNER on GitHub, posted by @mountains, 2026-10-12