Template:Row numbers/doc: Difference between revisions
en>Trappist the monk (create;) |
en>Trappist the monk m (→Usage: ce;) |
||
Line 38: | Line 38: | ||
|_row_count || {{Str left|{{Lorem ipsum}}|123}} | |_row_count || {{Str left|{{Lorem ipsum}}|123}} | ||
|}</nowiki>}} | |}</nowiki>}} | ||
There are further caveats. When wrapped in {{tag|nowiki}}, the '<code><</code>' and '<code>></code>' characters that begin and end all html-like markup, are replaced with <code>&lt;</code> and <code>&gt;</code> html entities respectively. Because the Module cannot know if there are html entities already in use before the table was wrapped in the {{tag|nowiki}} tags required here, when the module replaces the html entities with '<code><</code>' and '<code>></code>' characters, something may break. {{lang|la|caveat lector}}. | There are further caveats. When wrapped in {{tag|nowiki}}, the '<code><</code>' and '<code>></code>' characters that begin and end all html-like markup, are replaced with <code>&lt;</code> and <code>&gt;</code> html entities respectively. Because the Module cannot know if there are html entities already in use before the table was wrapped in the {{tag|nowiki}} tags required here, when the module replaces the html entities with '<code><</code>' and '<code>></code>' characters, something may break. Also, these entitles are replaced with their associated characters: '<code>&amp;</code>', '<code>&quot;</code>', and '<code>&nbsp;</code>'. {{lang|la|caveat lector}}. | ||
<includeonly>{{sandbox other|| | <includeonly>{{sandbox other|| | ||
<!-- Categories below this line, please; interwikis at Wikidata --> | <!-- Categories below this line, please; interwikis at Wikidata --> | ||
}}</includeonly> | }}</includeonly> |
Revision as of 11:59, 12 April 2018
This is a documentation subpage for Template:Terminate sentence It may contain usage information, categories and other content that is not part of the original template page. |
This is an experimental template that serves as an interface to the experimental Module:Sandbox/trappist the monk/incrementor.
The goal of this experiment is to see it it is possible to have an incrementing row counter in a table so that adding or removing rows automatically adjusts the numbering of subsequent rows.
Because this is an experimental template, it may go away at any moment, for any reason.
Usage
This template takes one parameter: the table. There is a caveat: the table must be wrapped inside <nowiki>...</nowiki>
tags so that all of the pipe characters (|
) required in a wiki table do not confuse the template into thinking that they are all individual template parameters. Internally, the Module maintains a monotonically increasing counter. The Module looks for the keyword _row_count
in the table and replaces the keyword with the next value from the counter.
{{row counter| <nowiki>{| class="wikitable" |+test incrementor !count !! lorem |- |_row_count || {{Str left|{{Lorem ipsum}}|123}} |- |_row_count || {{Str left|{{Lorem ipsum}}|27}} |- |_row_count || {{Str left|{{Lorem ipsum}}|5}} |- |_row_count || {{Str left|{{Lorem ipsum}}|11}} |- |_row_count || {{Str left|{{Lorem ipsum}}|123}} |}</nowiki>}}
Template:Row counter
There are further caveats. When wrapped in <nowiki>...</nowiki>
, the '<
' and '>
' characters that begin and end all html-like markup, are replaced with <
and >
html entities respectively. Because the Module cannot know if there are html entities already in use before the table was wrapped in the <nowiki>...</nowiki>
tags required here, when the module replaces the html entities with '<
' and '>
' characters, something may break. Also, these entitles are replaced with their associated characters: '&
', '"
', and '
'. caveat lector.