On 28 June 2012 00:00, Platonides <Platonides(a)gmail.com> wrote:
On 27/06/12 13:31, Carnë Draug wrote:
I expected that this would be a common thing and
that I'd find many
templates already doing this but actually found none. The
recommendation on wikipedia is to use <syntaxhighlight> directly
(which I'd like to avoid since we want to change the default look of
it and are already using a template to place the code inside a table
with a title and legend). The alternatives that I see are:
* use wikipedia's {{!}} template (it does solve my problem)
* modify the actual extension code so it does all I want and use
that instead of a template
However, none of them sound right. Does anyone knows how to solve this?
Any of them would work. The {{!}} template is really embedded into the
wikitext usage. It probably should be put into the core.
I was giving it some more thought and it occurred to me that maybe it
could be fixed with a for loop. Something like the following (if I
could write it in perl)
for ($i = 1; i < $nParameters; i++) {
print "{{{$i}}};{{{!}}}";
}
print "{{{$nParameters}}};
It's a ugly thing but it would spare the editors from typing {{{!}}}
every time and catching them by surprise. I found out how to do a for
loop with the following extension
http://www.mediawiki.org/wiki/Extension:LoopFunctions but haven't
found a way to get the number of parameters given. Is there such a
thing?
This is a wiki for a programming language where the pipe character is
used a lot, hence my attempt to fix this in some other way.
Thanks in advance,
Carnë