pgrandjean
pgrandjean

Reputation: 766

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.

Upvotes: 2

Views: 315

Answers (2)

Yichi Chen
Yichi Chen

Reputation: 31

now the content should be the second param, as follows:

{{#tag:syntaxhighlight|{{{code|}}}|lang=cpp|}}

for the question, it should be:

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

Upvotes: 2

Tgr
Tgr

Reputation: 28220

Use #tag:

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

Upvotes: 3

Related Questions