Jump to content
Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Source: Difference between revisions

Template page
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|}}}}}}|,&#32;posted by&#32;}}}}{{#if:{{{handle|{{{1|}}}}}}|{{#if:{{{link|{{{3|}}}}}}|[{{{link|{{{3|}}}}}} @{{#replace:{{{handle|{{{1|}}}}}}|@|}}]|@{{#replace:{{{handle|{{{1|}}}}}}|@|}}}}}}{{#if:{{{date|{{{2|}}}}}}|{{#if:{{{handle|{{{1|}}}}}}{{{repo|}}}|,&#32;}}{{{date|{{{2|}}}}}}}}{{#if:{{{note|}}}|&#32;({{{note}}})}}</span></includeonly><noinclude><templatestyles src="Infobox/styles.css" />
Credit line for an imported fact. Usage: <code><nowiki>{{Source|mountains|2026-10-12|https://discord.com/channels/GUILD/CHANNEL/MESSAGE}}</nowiki></code>
Credit line for an imported fact.
or with names: <code><nowiki>{{Source|handle=mountains|date=2026-10-12|link=https://discord.com/channels/...}}</nowiki></code>.


Example: {{Source|mountains|2026-10-12|https://discord.com/channels/1/2/3}}
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 &lt;url&gt; by &lt;owner&gt; 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-DD
  • link (or 3): the Discord message link
  • note: a short qualifier shown in brackets at the end, for example lab notes or translated
  • repo: 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