Nested Order List with Different Types at different levels

Kolen's Avatar

Kolen

11 Feb, 2016 12:39 AM

I hope it isn't repeated:

Currently if I typed

  1. test
  2. testing
    1. testing
    2. testing
  3. testing

In HTML output, the numbered at different levels are the "same" (meaning decimal numbers).

Would you consider to add support HTML ol type Attribute so that different levels have different type of numbering? e.g. follow the LaTeX convention.

  1. Support Staff 1 Posted by fletcher on 11 Feb, 2016 01:14 AM

    fletcher's Avatar

    That's a job for CSS -- you can use whatever numbering systems you like
    if you use the proper CSS.

    Fletcher

  2. 2 Posted by Kolen on 11 Feb, 2016 11:46 PM

    Kolen's Avatar

    Oh, I see.

    The following css will then replicate the LaTeX output:

    ol {
        list-style-type: decimal;
    }
    ol ol {
        list-style-type: lower-alpha;
    }
    ol ol ol {
        list-style-type: lower-roman;
    }
    ol ol ol ol{
        list-style-type: upper-alpha;
    }
    

    I see that currently MMD5 already use different style for unordered list, would you consider to add styling in ordered list too?

    I put a css in ickc/multimarkdown-latex-css: Using CSS to make the MultiMarkdown to HTML output mimics the MultiMarkdown to LaTeX output so that the styling will be different up to level 6 nesting for both ul and ol.

  3. 3 Posted by Kolen on 12 Feb, 2016 09:01 AM

    Kolen's Avatar

    Could you also change the list generated by the {{TOC}} to be an ordered list instead? This way I can setup a CSS to control how the numbering will be in the TOC as well. Thanks.

  4. 4 Posted by Kolen on 12 Feb, 2016 09:45 AM

    Kolen's Avatar

    Forget my last request, the following would do it:

    .TOC ul {
      counter-reset: section;
      list-style-type: none;
    }
    .TOC li::before {
      counter-increment: section;
      content: counters(section,".") ". ";
    }
    <pre><code></code>
    </pre>
    
  5. Kolen closed this discussion on 02 Mar, 2016 02:51 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

22 Apr, 2018 11:04 PM
13 Apr, 2018 10:58 PM
09 Apr, 2018 09:47 PM
09 Apr, 2018 04:28 PM
19 Feb, 2018 10:29 PM

Recent Articles