Any better way to create MediaWiki numbered lists?

后端 未结 11 896
梦如初夏
梦如初夏 2021-02-01 13:09

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:



        
相关标签:
11条回答
  • 2021-02-01 13:55

    I use <ol></ol> and <li></li> to embed the <pre></pre> code formatting portions. Works great for me! :-)

    0 讨论(0)
  • 2021-02-01 13:58

    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:

    1. Item 1

    2. 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!

    0 讨论(0)
  • 2021-02-01 14:00

    Following the link to Wiki Help, I found an example that meets what I think are the implied requirements

    1. The list needs to keep numbering
    2. Sometimes the "Somestuff" should be on it's own line in the source

    To get (1) there are a few solutions proposed. Bug one way is to use paragraph delimiters around the extra "somestuff".

    Example 1:

    # Paragraph 1.<p>Paragraph 2.</p><p>Paragraph 3.</p>
    # Second item.
    

    To meet (2), you use paragraph marking in combination with commenting out the new lines (with <!-- newline-->).

    Example 2:

    # Paragraph 1.<!--
      --><p>Paragraph 2.</p><!--
      --><p>Paragraph 3.</p>
    # Second item.
    

    Both examples display as

    Result:

    
        1. Paragraph 1.
           Paragraph 2.
           Paragraph 3.
        2. Second item
    

    Note that the comment eats all of the white space between the end of one element and the start of the next, which seems to be standard practice, and makes sense if you're trying to have whitespace without the "wiki effects" of the white space.

    0 讨论(0)
  • 2021-02-01 14:01

    Extension:ComplexList

    https://www.mediawiki.org/w/index.php?oldid=2126533

    was put together but not maintained (for lack of time). It works with 1.26.2 of MediaWiki.

    For example.

    <cl>
    1. list item A1
    
    * list item A2
    
    continuing list item A2
    
    further continuing list item A2
    
    * list item A3
    </cl>

    becomes

    1. list item A1
    2. list item A2
      continuing list item A2
      further continuing list item A2
    3. list item A3
    0 讨论(0)
  • 2021-02-01 14:02

    I'm using Mediawiki 1.13.3 and this works:

    #Item1
    Somestuff
    <ol start="2">
    <li>Item2 </li>
    </ol>
    
    0 讨论(0)
提交回复
热议问题