User:Ian07/Test/Template: Difference between revisions

From LifeWiki
Jump to navigation Jump to search
mNo edit summary
thread support for Template:CiteDiscord
Line 1: Line 1:
<includeonly>{{#if: {{{rulemin|}}}{{{rulemax|}}}{{{rulespecial|}}} | <tr>
<includeonly>{{#if: {{{author|}}} | {{{author}}}{{#if: {{{date|}}} | &nbsp;({{{date}}}) }}. }} {{#if: {{{id|}}} | {{#if: {{{channel|}}} | {{#if: {{ChannelID|{{{channel}}}}} | [https://discord.com/channels/357922255553953794/{{ChannelID|{{{channel}}}}}/{{{id}}} Message in #{{{channel}}}] | '''Error: Invalid channel name {{{channel}}}. If message is located inside a thread, use ''thread'' and ''threadid'' parameters.'''}} | {{#if: {{{thread|}}} | {{#if: {{{threadid|}}} | [https://discord.com/channels/357922255553953794/{{{threadid}}}/{{{id}}} Message in thread "{{{thread}}}"] | '''Error: Either channel name or thread name+ID required!'''}} | '''Error: Either channel name or thread name+ID required!'''}} }} | '''Error: Message ID required!'''}} on the [[Conwaylife Lounge]] Discord server [[Category:Pages that link to the Conwaylife Lounge]]</includeonly><noinclude>This is a template for including links to messages on the '''[https://discord.gg/BCuYCEn Conwaylife Lounge]''' Discord server in the "References" section of an article. It can take the following parameters:
<td colspan="2" style="height:3px;"></td></tr>
 
<tr>
* ''channel'', the name of the channel (excluding threads) the message was posted in, without the # sign:
<td colspan="2" style="background-color:#A7A8C1;height:2px;"></td></tr>
** Options are ''starboard'', ''rules'', ''info'', ''announcements'', ''general-discussion'', ''off-topic'', ''tools'', ''cgol'', ''naturalistic'', ''engineered'', ''general-theory'', ''other-math'', ''programming'', ''bots-and-mute-this'', and ''boice-text'';
<tr>
* ''thread'', the name of the thread the message was posted in, where applicable
<td colspan="2">
* ''threadid'', the numerical ID of the thread, where applicable (this can be obtained clicking on the three dots to the right of the message, clicking "Copy Message Link", and copying the middle of the three numbers; it is also equal to the message ID of the first message in the thread)
<table class="infobox_table collapsible collapsed" style="width:100%">
* ''id'', the numerical ID of the message (this can be obtained by clicking on the three dots to the right of the message and clicking "Copy ID");
<tr>
* ''author'', the author of the message (optional);
<th colspan="2" class="infobox_subhead">[[Life-like cellular automaton|Rules]]</th></tr>
* ''date'', the date the message was posted (optional, if ''author'' is specified);
<tr>
 
<th> [[Outer-totalistic]]&nbsp;rules </th>
Here are three simple usage examples:
<td style="text-align:right;"> {{#ifeq: {{{rulemin|}}} | {{{rulemax|}}} | {{{rulemax|}}} only | {{#if:{{{rulemin|}}}|{{{rulemin}}}|unknown}}&nbsp;–&nbsp;{{#if:{{{rulemax|}}}|{{{rulemax}}}|unknown}}}}</td><tr />
 
{{#if: {{{rulespecial|}}} | <tr>
'''You type:'''
<th> Important&nbsp;rules </th>
 
<td style="text-align:right;" valign="top"> {{{rulespecial|}}} </td></tr>
<tt><nowiki>{{CiteDiscord|channel=cgol|id=700583344085139496}}</nowiki></tt>
}}<tr>
 
<th> #&nbsp;of&nbsp;rules </th>
'''You see:'''
<td style="text-align:right;"> {{#if: {{{rulemin|}}} | {{#if: {{{rulemax|}}} | 2<sup>{{#expr:{{#len:{{{rulemax|}}}}}-{{#len:{{{rulemin|}}}}}}}</sup> = {{#expr: 2^({{#len:{{{rulemax|}}}}}-{{#len:{{{rulemin|}}}}})}} | Unknown }} | Unknown }} </td></tr>
 
{{#if: {{{isorulemin|}}}{{{isorulemax|}}} | <tr>
[https://discord.com/channels/357922255553953794/370571014654001154/700583344085139496 Message in #cgol] on the [[Conwaylife Lounge]] Discord server
<th> [[Isotropic non-totalistic|Isotropic]]&nbsp;rules </th>
 
<td style="text-align:right;"> {{#ifeq: {{{isorulemin|}}} | {{{isorulemax|}}} | {{{isorulemax|}}} only | {{#if:{{{isorulemin|}}}|{{{isorulemin}}}|unknown}}&nbsp;–&nbsp;{{#if:{{{isorulemax|}}}|{{{isorulemax}}}|unknown}}}}</td></tr>
'''You type:'''
}}</table>
 
</td></tr>
<tt><nowiki>{{CiteDiscord|thread=Life Miner|threadid=870565047947108373|id=870793282718957608}}</nowiki></tt>
}}{{#if: {{{synthesis|}}}{{{synthesis2|}}}{{{synthesisRLE|}}}{{{pentadecathlonid|}}} | <tr>
 
<td colspan="2" style="height:3px;"></td></tr>
'''You see:'''
<tr>
 
<td colspan="2" style="background-color:#A7A8C1;height:2px;"></td></tr>
[https://discord.com/channels/357922255553953794/870565047947108373/870793282718957608 Message in thread "Life Miner"] on the [[Conwaylife Lounge]] Discord server
<tr>
 
<td colspan="2"><table class="infobox_table collapsible collapsed" style="width:100%"><tr><th colspan="2" class="infobox_subhead"> [[Glider synthesis]] </th></tr>
'''You type:'''
{{#ifeq: {{{synthesis|}}} | 0 | <tr>
 
<td colspan="2" style="text-align:center;"> Synthesis is [[:Category:Patterns that can not be constructed with gliders|not possible]].</td></tr> |  
<tt><nowiki>{{CiteDiscord|author=Mateon1|date=April 17, 2020|channel=cgol|id=700583344085139496}}</nowiki></tt>
{{#if: {{{synthesis|}}} | <tr>
 
<th> Fewest&nbsp;[[glider]]s {{#if: {{{synthesis2|}}}{{{apgcode2|}}} | (canonical)}} </th>
'''You see:'''
<td style="text-align:right;"> [[:Category:Patterns that can be constructed with {{GlidersCategoryName|{{{synthesis|}}}}} gliders|{{{synthesis|}}}]]{{#ifexpr: 0{{{synthesis|0}}} > {{Reverse caber tosser/Lower bound}} | <sup>&dagger;</sup> | }} </td></tr>
 
}}{{#if: {{{apgcode|}}} | {{#if: {{{synthesis|}}} | <tr>
Mateon1 (April 17, 2020). [https://discord.com/channels/357922255553953794/370571014654001154/700583344085139496 Message in #cgol] on the [[Conwaylife Lounge]] Discord server
<th> [[Catagolue]]-generated [[RLE]] {{#if: {{{synthesis2|}}}{{{apgcode2|}}} | (canonical)}}</th>
 
<td style="text-align:right;"> [https://catagolue.hatsya.com/textsamples/{{{apgcode|apgcodenotfound}}}/b3s23/synthesis {{{pname|namenotfound}}}_synth.rle] </td></tr>
'''You type:'''
}}}}{{#if: {{{synthesis2|}}} | <tr>
 
<th> Fewest&nbsp;[[glider]]s (cheapest&nbsp;variant) </th>
<pre><nowiki><ref name="message700583344085139496" />
<td style="text-align:right;"> [[:Category:Patterns that can be constructed with {{GlidersCategoryName|{{{synthesis2|}}}}} gliders|{{{synthesis2|}}}]]{{#ifexpr: 0{{{synthesis2|0}}} > {{Reverse caber tosser/Lower bound}} | <sup>&dagger;</sup> | }} </td></tr>
 
}}{{#if: {{{apgcode2|}}} | <tr>
==References==
<th> [[Catagolue]]-generated [[RLE]] (cheapest&nbsp;variant) </th>
<references>
<td style="text-align:right;"> [https://catagolue.hatsya.com/textsamples/{{{apgcode2|apgcodenotfound}}}/b3s23/synthesis {{{pname|namenotfound}}}_synth.rle] </td></tr>
<ref name="message700583344085139496">{{CiteDiscord
}}{{#if: {{{synthesisRLE|}}} | <tr>
|author  = Mateon1
<th> Uploaded synthesis [[RLE]] </th>
|date    = April 17, 2020
<td style="text-align:right;"> [https://www.conwaylife.com/patterns/{{{pname|namenotfound}}}_synth.rle {{{pname|namenotfound}}}_synth.rle] </td></tr>
|channel = cgol
| {{#ifexist:RLE:{{{pname}}}_synth|<tr>
|id      = 700583344085139496
<th>[[RLE]]</th>
}}</ref>
<td style="text-align:right;"> [[RLE:{{{pname}}}_synth|raw RLE code]] [[Category:Pages with raw synthesis RLE code but no uploaded synthesis files]] </td></tr> }} }} }}
</references></nowiki></pre>
<!--{{#if: {{{apgcode|}}} | <tr>
 
<th> Auto-generated synthesis </th>
'''You see:''' a footnote link<sup>1</sup> at the '''ref''' tag location, and a reference section containing
<td style="text-align:right; word-break: break-all"> [https://glidersynth.neocities.org/?{{{apgcode|}}} {{{apgcode|}}}]<br />[https://catagolue.hatsya.com/js/glidersynth.html?{{{apgcode|}}} {{{apgcode|}}}] (alt.)</td></tr>
 
}}-->
1. Mateon1 (April 17, 2020). [https://discord.com/channels/357922255553953794/370571014654001154/700583344085139496 Message in #cgol] on the [[Conwaylife Lounge]] Discord server
{{#if: {{{pentadecathlonid|}}} |
</noinclude>
<tr>
<th> As source </th>
<td style="text-align:right;"> [http://pentadecathlon.com/objects/object-info.php?objid={{{pentadecathlonid|}}}&content=foundations {{{pentadecathlonid|}}}] </td></tr>
<tr>
<th> As result </th>
<td style="text-align:right;"> [http://pentadecathlon.com/objects/object-info.php?objid={{{pentadecathlonid|}}}&content=constructions {{{pentadecathlonid|}}}] </td></tr>
}}{{#ifexpr: 0{{{synthesis|0}}} > {{Reverse caber tosser/Lower bound}} or 0{{{synthesis2|0}}} > {{Reverse caber tosser/Lower bound}} | <tr>
<td colspan="2"><sup>&dagger;</sup>Can be constructed with {{Reverse caber tosser/Lower bound}} gliders using the [[reverse caber tosser]] [[universal constructor]].</td></tr>
}}</table></td></tr> }} {{#if: {{{zip|}}}{{{mc|}}}{{{plaintext|}}}{{{rle|}}}{{#ifexist:RLE:{{{pname}}}|true|}} |
<tr>
<td colspan="2" style="height:3px;"></td></tr>
<tr>
<td colspan="2" style="background-color:#A7A8C1;height:2px;"></td></tr>
<tr>
<td colspan="2">
<table class="infobox_table collapsible collapsed" style="width:100%">
<tr>
<th colspan="2" class="infobox_subhead"> Pattern files </th></tr>
{{#if: {{{mc|}}} | <tr>
<th>[[Macrocell]]</th>
<td style="text-align:right;"> [https://www.conwaylife.com/patterns/{{{pname|name}}}.mc {{{pname|name}}}.mc]</td></tr>
}} {{#if: {{{plaintext|}}} | <tr>
<th>[[Plaintext]]</th>
<td style="text-align:right;"> [https://www.conwaylife.com/patterns/{{{pname|name}}}.cells {{{pname|name}}}.cells]</td></tr>
}} {{#if: {{{rle|}}} | <tr>
<th>[[RLE]]</th>
<td style="text-align:right;"> [https://www.conwaylife.com/patterns/{{{pname|name}}}.rle {{{pname|name}}}.rle]</td></tr>
| {{#ifexist:RLE:{{{pname}}}|<tr>
<th>[[RLE]]</th>
<td style="text-align:right;"> [[RLE:{{{pname}}}|raw RLE code]]</td></tr>
{{#if: {{{zip|}}}{{{mc|}}}{{{life105|}}}{{{life106|}}}{{{plaintext|}}}||[[Category:Pages with raw RLE code but no uploaded pattern files]]}}}}
}} {{#if: {{{zip|}}} | <tr>
<th>Zip archive</th>
<td style="text-align:right;"> [https://www.conwaylife.com/patterns/{{{pname|name}}}.zip {{{pname|name}}}.zip]</td></tr>
}}</table>
}}
{{#ifeq:{{NAMESPACE}}|User||{{#ifeq:{{NAMESPACE}}|Template||
{{#if: {{{synthesis|}}} | {{#ifeq: {{{synthesis|}}} | 0 | [[Category:Patterns that can not be constructed with gliders]] | [[Category:Patterns that can be constructed with {{GlidersCategoryName|{{{synthesis|}}}}} gliders]] }} }}{{#if: {{{rulemin|}}} | {{#if: {{{rulemax|}}} | {{#ifeq: {{{rulemin}}} | {{{rulemax}}} | [[Category:Outer-totalistically endemic patterns]] }} | [[Category:Patterns with unknown or incomplete rule information]] }} | [[Category:Patterns with unknown or incomplete rule information]] }}{{#if: {{{rulespecial|}}} | | [[Category:Patterns with unknown or incomplete rule information]] }}{{#if: {{{isorulemin|}}} | {{#if: {{{isorulemax|}}} | {{#ifeq: {{{isorulemin}}} | {{{isorulemax}}} | [[Category:Isotropically endemic patterns]] }} | [[Category:Patterns with unknown or incomplete rule information]] }} | [[Category:Patterns with unknown or incomplete rule information]] }} }} }}</includeonly>
<noinclude>This template displays the "Rules", "Glider synthesis" and "Pattern files" boxes that appear on the right hand side of pattern pages. It should not be used on its own, but only within other pattern infobox templates such as [[Template:Pattern]] and [[Template:Oscillator]]. All of its parameters are passed in from the corresponding parameters of the template that calls it.</noinclude>

Revision as of 17:38, 26 September 2021

This is a template for including links to messages on the Conwaylife Lounge Discord server in the "References" section of an article. It can take the following parameters:

  • channel, the name of the channel (excluding threads) the message was posted in, without the # sign:
    • Options are starboard, rules, info, announcements, general-discussion, off-topic, tools, cgol, naturalistic, engineered, general-theory, other-math, programming, bots-and-mute-this, and boice-text;
  • thread, the name of the thread the message was posted in, where applicable
  • threadid, the numerical ID of the thread, where applicable (this can be obtained clicking on the three dots to the right of the message, clicking "Copy Message Link", and copying the middle of the three numbers; it is also equal to the message ID of the first message in the thread)
  • id, the numerical ID of the message (this can be obtained by clicking on the three dots to the right of the message and clicking "Copy ID");
  • author, the author of the message (optional);
  • date, the date the message was posted (optional, if author is specified);

Here are three simple usage examples:

You type:

{{CiteDiscord|channel=cgol|id=700583344085139496}}

You see:

Message in #cgol on the Conwaylife Lounge Discord server

You type:

{{CiteDiscord|thread=Life Miner|threadid=870565047947108373|id=870793282718957608}}

You see:

Message in thread "Life Miner" on the Conwaylife Lounge Discord server

You type:

{{CiteDiscord|author=Mateon1|date=April 17, 2020|channel=cgol|id=700583344085139496}}

You see:

Mateon1 (April 17, 2020). Message in #cgol on the Conwaylife Lounge Discord server

You type:

<ref name="message700583344085139496" />

==References==
<references>
<ref name="message700583344085139496">{{CiteDiscord
|author  = Mateon1
|date    = April 17, 2020
|channel = cgol
|id      = 700583344085139496
}}</ref>
</references>

You see: a footnote link1 at the ref tag location, and a reference section containing

1. Mateon1 (April 17, 2020). Message in #cgol on the Conwaylife Lounge Discord server