Template:EmbedViewer: Difference between revisions

From LifeWiki
Jump to navigation Jump to search
Confocal (talk | contribs)
relink to a later post
Confocal (talk | contribs)
m collect remaining AUTOSTART STOP cases for conversion to STARTFROM
 
(6 intermediate revisions by the same user not shown)
Line 2: Line 2:
| right = <div class="thumb tnone" style="float: right; {{{style|margin-left: 1em; margin-bottom: 1em;}}}"><div class="thumbinner"><div class="image">{{LV:Viewer|{{{rle|{{RLE:{{{pname}}}}}}}}
| right = <div class="thumb tnone" style="float: right; {{{style|margin-left: 1em; margin-bottom: 1em;}}}"><div class="thumbinner"><div class="image">{{LV:Viewer|{{{rle|{{RLE:{{{pname}}}}}}}}
{{LifeViewer config/default}}
{{LifeViewer config/default}}
{{{viewerconfig|}}}}}</div><div class="thumbcaption">{{{caption|}}} (click&nbsp;above&nbsp;to&nbsp;open&nbsp;[[LifeViewer]]){{#if: {{{pname|}}} | <br>'''[[RLE]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.rle here] '''[[Plaintext]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.cells here] | }}{{#if: {{{apgcode|}}} | <br>{{LinkCatagolue|{{#explode:{{{apgcode}}}|/|0}}|rule={{#if: {{#explode:{{{apgcode}}}|/|1}} | {{#explode:{{{apgcode}}}|/|1}} | b3s23}}|style=brief}} | }}</div></div></div>
{{{viewerconfig|}}}}}</div><div class="thumbcaption">{{EmbedViewerCaption|caption={{{caption|}}}|pname={{{pname|}}}|apgcode={{{apgcode|}}}}}</div></div></div>
| left = <div class="thumb tnone" style="float: left; {{{style|margin-right: 1em; margin-bottom: 1em;}}}"><div class="thumbinner"><div class="image">{{LV:Viewer|{{{rle|{{RLE:{{{pname}}}}}}}}
| left = <div class="thumb tnone" style="float: left; {{{style|margin-right: 1em; margin-bottom: 1em;}}}"><div class="thumbinner"><div class="image">{{LV:Viewer|{{{rle|{{RLE:{{{pname}}}}}}}}
{{LifeViewer config/default}}
{{LifeViewer config/default}}
{{{viewerconfig|}}}}}</div><div class="thumbcaption">{{{caption|}}} (click&nbsp;above&nbsp;to&nbsp;open&nbsp;[[LifeViewer]]){{#if: {{{pname|}}} | <br>'''[[RLE]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.rle here] '''[[Plaintext]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.cells here] | }}{{#if: {{{apgcode|}}} | <br>{{LinkCatagolue|{{#explode:{{{apgcode}}}|/|0}}|rule={{#if: {{#explode:{{{apgcode}}}|/|1}} | {{#explode:{{{apgcode}}}|/|1}} | b3s23}}|style=brief}} | }}</div></div></div>
{{{viewerconfig|}}}}}</div><div class="thumbcaption">{{EmbedViewerCaption|caption={{{caption|}}}|pname={{{pname|}}}|apgcode={{{apgcode|}}}}}</div></div></div>
| center = <table class="toccolours" style="margin-left: auto; margin-right: auto; width: fit-content; {{{style|}}}"><tr><td align="center">{{LV:Viewer|{{{rle|{{RLE:{{{pname}}}}}}}}
| center = <table class="toccolours" style="margin-left: auto; margin-right: auto; width: fit-content; {{{style|}}}"><tr><td align="center">{{LV:Viewer|{{{rle|{{RLE:{{{pname}}}}}}}}
{{LifeViewer config/default}}
{{LifeViewer config/default}}
{{{viewerconfig|}}}}}</td></tr><tr><td align="center">{{{caption|}}} (click&nbsp;above&nbsp;to&nbsp;open&nbsp;[[LifeViewer]]){{#if: {{{pname|}}} | <br>'''[[RLE]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.rle here] '''[[Plaintext]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.cells here] | }}{{#if: {{{apgcode|}}} | <br>{{LinkCatagolue|{{#explode:{{{apgcode}}}|/|0}}|rule={{#if: {{#explode:{{{apgcode}}}|/|1}} | {{#explode:{{{apgcode}}}|/|1}} | b3s23}}|style=brief}} | }}</td></tr></table>
{{{viewerconfig|}}}}}</td></tr><tr><td align="center">{{EmbedViewerCaption|caption={{{caption|}}}|pname={{{pname|}}}|apgcode={{{apgcode|}}}}}</td></tr></table>
}}{{#if: {{{pname|}}} | | {{#if:{{NAMESPACE}} | {{#ifeq:{{NAMESPACE}} | OCA | [[Category:Articles using EmbedViewer with no pname]] }} | [[Category:Articles using EmbedViewer with no pname]] }} }}</includeonly><noinclude>
}}{{#if: {{{pname|}}} | | {{#if:{{NAMESPACE}} | {{#ifeq:{{NAMESPACE}} | OCA | [[Category:Articles using EmbedViewer with no pname]] }} | [[Category:Articles using EmbedViewer with no pname]] }} }}<!--
{{EmbedViewer
-->{{#switch:{{NAMESPACENUMBER}}|0|102={{#if:{{#pos:{{{viewerconfig|}}}|AUTOSTART STOP}}{{#pos:{{{caption|}}}|<br}}|[[Category:Pages needing cleanup]]}}|}}</includeonly><noinclude>{{/Doc}}</noinclude>
|pname        = richsp16
|viewerconfig = #C [[ AUTOSTART GPS 4 THUMBSIZE 2 ]]
|caption      = [[Rich's p16]]
}}
This template can be used to embed a floating [[LifeViewer]] applet in an article, using an [[RLE]] code snippet from the <tt>RLE:</tt> namespace. It takes the following parameters:
 
Pattern: '''one''' of:
 
* rle: RLE snippet.
* pname: name of the RLE snippet in the <tt>RLE:</tt> namespace (without the <tt>RLE:</tt> prefix).
 
Other:
 
* position: position.
** Possible values are <tt>left</tt> (floating left), <tt>right</tt> (floating right) and <tt>center</tt>. Default: <tt>right</tt>.
* style: additional CSS styling. Default:
** <tt>position = right</tt>: <tt>margin-left: 1em; margin-bottom: 1em</tt>
** <tt>position = left</tt>: <tt>margin-right: 1em; margin-bottom: 1em</tt>
** <tt>position = center</tt>: (none)
* viewerconfig: additional LifeViewer configuration to use.
** This may include waypoint animation commands, theme or color settings, labels, arrows or polylines, etc.
** See LifeViewer Help for details - click on LifeViewer, type '''h''', then choose '''Scripts'''.
** To avoid cell distortion, even integer values are recommended for ZOOM parameters.<ref>See the discussion for more details:{{br}}{{LinkForumThread|p=153028|title=Re: Pattern viewer for forum threads|format=ref}}</ref>
* caption: the caption to use.
* apgcode: adds a [[Catagolue]] link at the bottom to a specific apgcode.
** Defaults to B3/S23; for other rules, append a slash followed by the rulestring e.g. <tt>xq48_07z8ca7zy1e531/b36s23</tt> for the {{LinkCatagolue|xq48_07z8ca7zy1e531|rule=b36s23|patternname=HighLife bomber|style=raw}}
 
Example: the viewer at the right was created using the following call:
 
<nowiki>{{EmbedViewer</nowiki>
<nowiki>|pname        = richsp16</nowiki>
<nowiki>|viewerconfig = #C [[ AUTOSTART GPS 4 THUMBSIZE 2 ]]</nowiki>
<nowiki>|caption      = [[Rich's p16]]</nowiki>
<nowiki>}}</nowiki>
 
It could also have been created directly without defining the "richsp16" pname and adding the RLE to the [[RLE:richsp16]] article, as follows:
 
<nowiki>{{EmbedViewer</nowiki>
<nowiki>|rle          = 3bo5bo$2b3o3b3o$bobobobobobo$2obobobobob2o$ob4ob4obo$5o3b5o3$4b2ob2o$</nowiki>
<nowiki>                3bobobobo$4bo3bo!</nowiki>
<nowiki>|position      = right</nowiki>
<nowiki>|viewerconfig = #C [[ AUTOSTART GPS 4 THUMBSIZE 2 ]]</nowiki>
<nowiki>|caption      = [[Rich's p16]]</nowiki>
<nowiki>}}</nowiki>
 
==References==
<references />
 
[[Category:LifeViewer templates]]
</noinclude>

Latest revision as of 03:44, 26 May 2023

x = 13, y = 10, rule = B3/S23 4bo3bo$2b2obobob2o$bo3bobo3bo$o3b2ob2o3bo$obo7bobo$bo9bo2$4b2ob2o$3bob obobo$4bo3bo! #C [[ THUMBSIZE 2 THEME 6 GRID GRIDMAJOR 0 SUPPRESS THUMBLAUNCH ]] #C [[ AUTOSTART GPS 4 THUMBSIZE 2 ]]
Rich's p16
(click above to open LifeViewer)
RLE: here Plaintext: here

The {{EmbedViewer}} template can be used to embed a floating LifeViewer applet in an article, using an RLE code snippet (either from the RLE: namespace, or specified directly as a parameter).

Parameters

The template takes the following parameters:

Pattern: one of:

  • rle: RLE snippet.
  • pname: name of the RLE snippet stored in the RLE: namespace (without the RLE: prefix).

Other:

  • position: position.
    • Possible values are left (floating left), right (floating right) and center. Default: right.
  • style: additional CSS styling. Default:
    • position = right: margin-left: 1em; margin-bottom: 1em
    • position = left: margin-right: 1em; margin-bottom: 1em
    • position = center: (none)
  • viewerconfig: additional LifeViewer configuration to use.
    • This may include waypoint animation commands, theme or color settings, labels, arrows or polylines, etc.
    • See LifeViewer Help for details - click on LifeViewer, type h, then choose Scripts.
    • To prevent cell distortion, even integer values may be preferable for ZOOM parameters assuming THUMBSIZE 2 (more generally, multiples of THUMBSIZE).[1]
  • caption: the caption to use.
  • apgcode: adds a Catagolue link at the bottom to a specific apgcode.
    • Defaults to B3/S23; for other rules, append a slash followed by the rulestring e.g. xq48_07z8ca7zy1e531/b36s23 for the HighLife bomber

Example: the viewer at the right was created using the following call:

{{EmbedViewer
|pname        = richsp16
|viewerconfig = #C [[ AUTOSTART GPS 4 THUMBSIZE 2 ]]
|caption      = [[Rich's p16]]
}}

It could also have been created directly without defining the "richsp16" pname and adding the RLE to the RLE:richsp16 article, as follows:

{{EmbedViewer
|rle          = 3bo5bo$2b3o3b3o$bobobobobobo$2obobobobob2o$ob4ob4obo$5o3b5o3$4b2ob2o$
                3bobobobo$4bo3bo!
|position      = right
|viewerconfig = #C [[ AUTOSTART GPS 4 THUMBSIZE 2 ]]
|caption      = [[Rich's p16]]
}}

See also

References

  1. ↑ See the discussion for more details:
    Re: Pattern viewer for forum threads (discussion thread) at the ConwayLife.com forums