Jump to content

Do not begin to migrate content here, it may be wiped without notice. More info.

Template:MoinMarkup/ParserSection

From Debian Wiki
<onlyinclude>{{#switch: {{{Parser|}}}
| wiki      = <div class="{{{ArgStr|}}}">{{{Output|}}}</div>
| bash
| irc
| python
| shell
| Makefile
| sh
| perl
| cplusplus
| diff
| html
| make
| makefile  = <syntaxhighlight lang="{{{Parser|}}}" {{#if:{{{ArgNumbers|}}}||line}}>{{{Content|}}}</syntaxhighlight>
| highlight = <syntaxhighlight lang="{{{ArgStr|}}}" {{#if:{{{ArgNumbers|}}}||line}}>{{{Content|}}}</syntaxhighlight>
| csv       = {{{Output|}}} <!-- TODO: CSV highlighting -->
}}{{Template:MoinMarkup/Boilerplate}}
</onlyinclude>

Please do not create new instances of this template.

When this wiki was converted from MoinMoin, we used MoinMarkup templates to represent anything that didn't translate neatly between the two formats. The goal is to gradually replace these with native MediaWiki equivalents.

The program that converted the old MoinMoin source always passes a unique MoinMarkupID= value as the first parameter, and the same value in MoinMarkupID2= as the last parameter. If you want to mass-edit every instance of this template (e.g. with the Replace Text extension), you should be able to search for something like {{MoinMarkup/ParserSection|MoinMarkupID=(\d+)(.*)|MoinMarkupID2=\1}}.

Parser section from a MoinMoin page

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
MoinMarkupIDMoinMarkupID

Unique ID for this template on the page, must be the first parameter.

Numberdeprecated
ContentContent

raw MoinMoin source

Stringdeprecated
ParserParser

Name of the parser

Suggested values
wiki highlight csv plain text bash irc python shell Makefile sh perl cplusplus diff html important make makefile note
Linedeprecated
ArgStrArgStr

Argument string passed to the parser. Suggested values are for the wiki parser, where this indicates the element's class

Suggested values
debian caution note important warning comment tip red/solid blue/solid comment/dashed yellow yellow/solid comment/dotted blue solid green/solid dashed dotted red table-of-contents tabular
Linedeprecated
ArgNumbersArgNumbers

For the highlight parser, indicates whether numbers are shown. 'off' means 'hide line numbers but show a toggle button', 'disable' means 'hide line numbers and toggle button'.

Suggested values
disable off no
Default
on
Linedeprecated
ArgDelimiterArgDelimiter

For the csv parser, this indicates the character to separate values.

Suggested values
,
Default
;
Linedeprecated
OutputOutput

wikitext resembling MoinMoin's rendered output

Contentdeprecated
MoinMarkupID2MoinMarkupID2

Same value as MoinMarkupID=, guaranteed to be the last parameter

Numberdeprecated

Some notes about this template:

  • this treats any value for ArgNumbers as disabling line numbers
    • numbers=no isn't supported by MoinMoin, but it's easier to just honour the author's intent
    • some pages use numbers=disable or numbers=off to work around the fact that MoinMoin's line-numbering breaks copy+paste - those pages might look OK with MediaWiki line-numbering
  • #!important and #!note occur in the list of common parsers, which includes older revisions