Template:EmbedViewer: Difference between revisions

From LifeWiki
Jump to navigation Jump to search
add second example using direct "rle" parameter, plus some notes about LifeViewer
moving conwaylife URLs to https to get around issue with http links not working
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 above to open [[LifeViewer]]){{#if: {{{pname|}}} | <br>'''[[RLE]]:''' [http://www.conwaylife.com/patterns/{{{pname}}}.rle here] '''[[Plaintext]]:''' [http://www.conwaylife.com/patterns/{{{pname}}}.cells here] | }}</div></div></div>
{{{viewerconfig|}}}}}</div><div class="thumbcaption">{{{caption|}}} (click above to open [[LifeViewer]]){{#if: {{{pname|}}} | <br>'''[[RLE]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.rle here] '''[[Plaintext]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.cells here] | }}</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 above to open [[LifeViewer]]){{#if: {{{pname|}}} | <br>'''[[RLE]]:''' [http://www.conwaylife.com/patterns/{{{pname}}}.rle here] '''[[Plaintext]]:''' [http://www.conwaylife.com/patterns/{{{pname}}}.cells here] | }}</div></div></div>
{{{viewerconfig|}}}}}</div><div class="thumbcaption">{{{caption|}}} (click above to open [[LifeViewer]]){{#if: {{{pname|}}} | <br>'''[[RLE]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.rle here] '''[[Plaintext]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.cells here] | }}</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 above to open [[LifeViewer]]){{#if: {{{pname|}}} | <br>'''[[RLE]]:''' [http://www.conwaylife.com/patterns/{{{pname}}}.rle here] '''[[Plaintext]]:''' [http://www.conwaylife.com/patterns/{{{pname}}}.cells here] | }}</td></tr></table>
{{{viewerconfig|}}}}}</td></tr><tr><td align="center">{{{caption|}}} (click above to open [[LifeViewer]]){{#if: {{{pname|}}} | <br>'''[[RLE]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.rle here] '''[[Plaintext]]:''' [https://www.conwaylife.com/patterns/{{{pname}}}.cells here] | }}</td></tr></table>
}}</includeonly><noinclude>
}}</includeonly><noinclude>
{{EmbedViewer
{{EmbedViewer

Revision as of 18:47, 25 July 2020

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

This template can be used to embed a floating LifeViewer applet in an article, using an RLE code snippet from the RLE: namespace. It takes the following parameters:

Pattern: one of:

  • rle: RLE snippet.
  • pname: name of the RLE snippet 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.
  • caption: the caption to use.

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]]
}}