Difference between revisions of "Template:Expand wikitext/doc"

From blackwiki
Jump to navigation Jump to search
imported>Pppery
(Per RM discussion on talk)
imported>Andrybak
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{confused|Template:Eval}}
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 
{{lua|Module:Expand wikitext}}
 
{{lua|Module:Expand wikitext}}
Interprets the input as wikitext using the <code>[[mw:Extension:Scribunto/Lua reference manual#frame:preprocess|frame:preprocess]]</code> function. If the entire input is in a nowiki tag, or if the optional parameter {{para|unstrip|yes}} is specified, first extracts the contents of nowiki tags before preprocessing. Any arguments passed to {{tl|preprocess}} are available in the preprocessed code, letting this be used as a rudimentary way of using variables.   
+
Interprets the input as wikitext using the <code>[[mw:Extension:Scribunto/Lua reference manual#frame:preprocess|frame:preprocess]]</code> function. If the entire input is in a nowiki tag, or if the optional parameter {{para|unstrip|yes}} is specified, first extracts the contents of nowiki tags before preprocessing. Any arguments passed to {{tl|{{BASEPAGENAME}}}} are available in the preprocessed code, letting this be used as a rudimentary way of using variables.   
  
 
== Example ==
 
== Example ==
<code>{{((}}Expand wikitext|{{tlp|Make code|<<As of!2015>>}}{{))}}</code> → {{Expand wikitext|{{Make code|<<As of!2015>>}}}}
+
* <code>{{((}}Expand wikitext|{{tlp|Make code|<<As of!2015!02>>}}{{))}}</code> → {{Expand wikitext|{{Make code|<<As of!2015!02>>}}}}
 +
* <code><nowiki>{{Expand wikitext|<nowiki>{{Episode list/sublist
 +
| 1              = One Piece (season 15)
 +
| EpisodeNumber  = {{{ep}}}
 +
| Title          = An Explosive Situation! Luffy vs. Fake Luffy!
 +
| OriginalAirDate = {{Date|2011-10-02 +{{#expr:({{{ep}}})-517}} weeks }}
 +
}}
 +
&lt;/nowiki>|ep=518}}</nowiki></code> → {{Expand wikitext|<nowiki>{{Episode list/sublist
 +
| 1              = One Piece (season 15)
 +
| EpisodeNumber  = {{{ep}}}
 +
| Title          = An Explosive Situation! Luffy vs. Fake Luffy!
 +
| OriginalAirDate = {{Date|2011-10-02 +{{#expr:({{{ep}}})-517}} weeks }}
 +
}}
 +
</nowiki>|ep=518}}
 +
* <code><nowiki>{{Expand wikitext|&lt;nowiki>{{2x|x}} -&lt;/nowiki>}}</nowiki></code> → {{Expand wikitext|<nowiki>{{2x|x}} -</nowiki>}}
 +
 
 
<includeonly>{{sandbox other||
 
<includeonly>{{sandbox other||
 
[[Category:Documentation assistance templates]]
 
[[Category:Documentation assistance templates]]
 
[[Category:Wikitext processing templates]]
 
[[Category:Wikitext processing templates]]
 
}}</includeonly>
 
}}</includeonly>

Latest revision as of 18:31, 27 May 2020

Interprets the input as wikitext using the frame:preprocess function. If the entire input is in a nowiki tag, or if the optional parameter |unstrip=yes is specified, first extracts the contents of nowiki tags before preprocessing. Any arguments passed to {{Expand wikitext}} are available in the preprocessed code, letting this be used as a rudimentary way of using variables.

Example

  • {{Expand wikitext|{{Make code|<<As of!2015!02>>}}}}Template:MultiReplace
  • {{Expand wikitext|<nowiki>{{Episode list/sublist | 1 = One Piece (season 15) | EpisodeNumber = {{{ep}}} | Title = An Explosive Situation! Luffy vs. Fake Luffy! | OriginalAirDate = {{Date|2011-10-02 +{{#expr:({{{ep}}})-517}} weeks }} }} </nowiki>|ep=518}} → 518"An Explosive Situation! Luffy vs. Fake Luffy!"9 October 2011
  • {{Expand wikitext|<nowiki>{{2x|x}} -</nowiki>}} → xx -