Reputation: 3125
I'm looking for the way to use nested numbering index of lists in MediaWiki pages. I want to get the following:
1 item "1"
2 item "2"
2.1 item "2.1"
2.2.1 item "2.2.1"
2.2.2 item "2.2.2"
2.2 item "2.2"
3 item "3"
I've found some CSS/HTML working code for HTML pages but I cannot fit it in a MediaWiki page.
Thanx in advance.
Upvotes: 1
Views: 490
Reputation: 8542
Something like this should work:
<ol class="nested-list">
<li>item "1"
<li>item "2"
<ol>
<li>item "2.1"
<li>item "2.2"
</ol>
</li>
</ol>
And then in MediaWiki:Commons.css
(if $wgUseSiteCss is true
, as per default), add something like this:
ol.nested-list { counter-reset: item }
ol.nested-list li { display: block }
ol.nested-list li:before { content: counters(item, ".") " "; counter-increment: item }
Upvotes: 1