wikimediawiki-extensionswikimedia

How to use template parameters in wiki syntaxhighlight?


I would like to use Template parameters within syntaxhighlight. For instance, something like:

 <syntaxhighlight lang="scala">
 val x: Boolean = {{{xVal}}}
 val y: Boolean = {{{yVal}}} | x
 </syntaxhighlight>

Where xVal and yVal are the template parameters to be replaced. The content is multiline and may contain pipe characters, etc.


Solution

  • Use #tag:

    {{#tag:syntaxhighlight|lang=scala|
    val x: Boolean = {{{xVal}}}
    val y: Boolean = {{{yVal}}} {{!}} x
    }}