Template:MoinMarkup/ParserSection: Difference between revisions
AndrewSayers (talk | contribs) Created page with "<pre><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 highligh..." |
AndrewSayers (talk | contribs) mNo edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
<pre><onlyinclude>{{#switch: {{{Parser|}}} | <pre><onlyinclude>{{#switch: {{{Parser|}}} | ||
| wiki = <div class="{{{ | | wiki = <div class="{{{1|}}}">{{{Output|}}}</div> | ||
| bash | | bash | ||
| irc | | irc | ||
| Line 13: | Line 13: | ||
| make | | make | ||
| makefile = <syntaxhighlight lang="{{{Parser|}}}" {{#if:{{{ArgNumbers|}}}||line}}>{{{Content|}}}</syntaxhighlight> | | makefile = <syntaxhighlight lang="{{{Parser|}}}" {{#if:{{{ArgNumbers|}}}||line}}>{{{Content|}}}</syntaxhighlight> | ||
| highlight = <syntaxhighlight lang="{{{ | | highlight = <syntaxhighlight lang="{{{1|}}}" {{#if:{{{ArgNumbers|}}}||line}}>{{{Content|}}}</syntaxhighlight> | ||
| csv = {{{Output|}}} <!-- TODO: CSV highlighting --> | | csv = {{{Output|}}} <!-- TODO: CSV highlighting, separated by {{{ArgDelimiter|{{{1|;}}}}}} --> | ||
}}{{Template:MoinMarkup/Boilerplate}} | }}{{Template:MoinMarkup/Boilerplate}} | ||
</onlyinclude></pre> | </onlyinclude></pre> | ||
| Line 41: | Line 41: | ||
"required": true, | "required": true, | ||
"description": "Name of the parser", | "description": "Name of the parser", | ||
"deprecated": true | |||
}, | |||
"1": { | |||
"type": "line", | |||
"suggestedvalues": ["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"], | |||
"required": false, | |||
"description": "First argument passed to the parser. Suggested values are for the wiki parser, where this indicates the element's class. For the CSV parser, this is synonymous with {{ArgDelimiter}}", | |||
"deprecated": true | "deprecated": true | ||
}, | }, | ||
"ArgStr": { | "ArgStr": { | ||
"type": "line", | "type": "line", | ||
"required": true, | "required": true, | ||
"description": " | "description": "Complete argument string passed to the parser", | ||
"deprecated": true | "deprecated": true | ||
}, | }, | ||
| Line 63: | Line 69: | ||
"default": ";", | "default": ";", | ||
"required": false, | "required": false, | ||
"description": "For the csv parser, this indicates the character to separate values.", | "description": "For the csv parser, this indicates the character to separate values. See also \"1\"", | ||
"deprecated": true | "deprecated": true | ||
}, | }, | ||
Latest revision as of 18:02, 5 April 2026
<onlyinclude>{{#switch: {{{Parser|}}}
| wiki = <div class="{{{1|}}}">{{{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="{{{1|}}}" {{#if:{{{ArgNumbers|}}}||line}}>{{{Content|}}}</syntaxhighlight>
| csv = {{{Output|}}} <!-- TODO: CSV highlighting, separated by {{{ArgDelimiter|{{{1|;}}}}}} -->
}}{{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
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| MoinMarkupID | MoinMarkupID | Unique ID for this template on the page, must be the first parameter. | Number | deprecated |
| Content | Content | raw MoinMoin source | String | deprecated |
| Parser | Parser | Name of the parser
| Line | deprecated |
| 1 | 1 | First argument passed to the parser. Suggested values are for the wiki parser, where this indicates the element's class. For the CSV parser, this is synonymous with {{ArgDelimiter}}
| Line | deprecated |
| ArgStr | ArgStr | Complete argument string passed to the parser | Line | deprecated |
| ArgNumbers | ArgNumbers | 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'.
| Line | deprecated |
| ArgDelimiter | ArgDelimiter | For the csv parser, this indicates the character to separate values. See also "1"
| Line | deprecated |
| Output | Output | wikitext resembling MoinMoin's rendered output | Content | deprecated |
| MoinMarkupID2 | MoinMarkupID2 | Same value as MoinMarkupID=, guaranteed to be the last parameter | Number | deprecated |
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