tags:

views:

2012

answers:

7

When using MediaWiki's markup language, the only thing that I hate is creating numbered lists. The only way I know to create a list is to do something like this:

#Item1
#Item2

However, if I want to add spaces or some other text between those lines, the numbering gets lost. For example, the following will create text that has two number one items:

#Item1
Somestuff
#Item2

Is there any way around this, or should I just use bullet points instead? I noticed just now that the stackoverflow system does not allow numbering like this, you have to do it all manually.

+9  A: 

Like this:

#Item1
#:Somestuff
#Item2
finnw
It doesn't work when you add markup like <pre>...</pre>
sw
+2  A: 

There are a couple of options, but you can start an ordered list from an arbitrary number like this:

#Item1

Something

<ol start="2">
#Item2
</ol>

You can also use "#:" if you don't mind "Something" being indented a lot:

#Item1
#:
#: Something
#:
#:Item2

There are quite a lot of options with lists, you can find more info on Wiki's Help Pages:List.

Andrew Johnson
A: 
+1  A: 

See:

http://www.gossamer-threads.com/lists/wiki/wikitech/156910?page=last

There is no better way.

+1  A: 

I'm using Mediawiki 1.13.3 and this works:

#Item1
Somestuff
<ol start="2">
<li>Item2
</ol>
Adrian Archer
+1  A: 

You can do:

# one
# two<br />spanning more lines<br />doesn't break numbering
# three
## three point one
## three point two

Regular old <br> works as well but probably pisses off someone.

You can put additional HTML formatting in as well to do <pre> formatting and the like without breaking the numbering as well. This also works other list formats.

From: http://www.mediawiki.org/wiki/Help%3AFormatting

josefwells
+1  A: 

The #: works, but you cannot create a section with spaces, so I would prefer the non-working option. Anyone knows a similar syntaxis that does the trick (start numbering at given value)?

This response is probably a bit late, but I figure I'll add it in case anyone stumbles across this, as I have. You can create a section with spaces by doing something like:

# Item 1
#: 
#: 
# Item 2

This will appear as:

Item 1

Item 2

Now, before you say this doesn't work, the trick is to add an ASCII no-break space after the #: rather than just simply hitting spacebar. You can add this by holding ALT on your keyboard and typing 0160. Doing this should add the usual Wiki paragraph formatting while preserving your numbering between #s.

Hope that helps!

Sam