In MediaWiki (wikipedia's) wiki syntax, is there a way to have a numbered list with a code block in the middle?
For example:
# Number 1 # Number 2 Indented section that will become a code block # Number 3 # Number 4
What happens in MediaWiki is you end up with something like this:
1. Number 1 2. Number 2 Indented section that will become a code block 1. Number 3 2. Number 4
(Note how "Number 3" and "Number 4" are reset as 1 and 2... It looks like StackOverflow is much smarter than MediaWiki, i had to put my example in PRE tags to make it screw up!)
I know you can indent text using "#:" syntax...
# Number 1 # Number 2 #: Indented section that will merely be indented # Number 3 # Number 4
...but I really would like to get the same visual CSS class for my code even if it's in a numbered list.
It gets even more entertaining with nested lists. This syntax...
# MainEntry 1 ## Number 1 ## Number 2 # MainEntry 2 ## Number 1 ## Number 2 Indented section that will become a code block ## Number 3 ## Number 4
...becomes...
1. MainEntry 1 1. Number 1 2. Number 2 2. MainEntry 2 1. Number 1 2. Number 2 Indented section that will become a code block 1. 1. Number 3 2. Number 4
(Note how "Number 3" is now "1. 1.")
The TechNet Wiki Editor has a Format Code Block option ( ). Click it, insert some code, select a language, click Preview to see it, tweak the code, and then click OK. The source code is now formatted and into your article!
When you go into the editing view of a wiki page, on the right hand side you will see a plus sign. Clicking on it will provide a short list of formatting codes as a help. You can edit this and custom design it for your worksite.
I have a numbered list and have to include images in each step. So I want to continure the numbering in the list. How can i do this? If they're in a sequence, you can use the # sign at the beginning of each paragraph.
You could try the following wiki syntax, it works for me on 1.17
# one #:<pre> #::some stuff #::some more stuff</pre> # two
It is not perfect, because you end up with a more indent but it does allow one to use the wiki syntax for correctly formatted pre blocks over multiple lines.
As previously mentioned, the other proper way would be to use HTML mark up.
<ol> <li>one</li> <li>two</li> <pre>some stuff some more stuff</pre> <li>three</li> </ol>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With