Hacker News new | past | comments | ask | show | jobs | submit login

Markdown needs nested ordered lists. I would like to convert legal documents to markdown, but I can't. For example:

1. Item one

2. Item two

    a. Subitem a

    b. Subitem b



I don't think standard Markdown as specified by John Gruber can handle that. You can't use (a,b,c). It has to be arabic numerals.

Markdown will ignore the actual value of the digits. (1,2,3) or (1,1,1) will both be rendered as (1,2,3). This is a result of the way that HTML & CSS deal with lists. The HTML has no way to specify the value to a list item. However, you can use CSS to specify the way each list nesting level is styled. So you can have a list that has Roman Numeral -> Uppercase Letter -> Arabic Numeral -> lowercase letter

Some enhanced version of Markdown may get you closer to what you want. I use MultiMarkdown and check it, but it doesn't support directly using (a,b,c) notation either.


> The HTML has no way to specify the value to a list item.

The "value" attribute of the HTML "li" element does exactly this, but setting the value isn't really what you need for what GP was asking for; setting the kind of marker is. This can, as you note, be done through CSS, but it can also be done through HTML (using the "type" attribute of the "ol" element.)

In the context of conversion of legal documents, where the marker type is intended for reference, it would be semantically correct to do this in HTML, so it would probably be desirable for markdown to support all the marker types supported by HTML for ordered list as markers for ordered lists, and set the type attribute correctly.

So, using a number should result in the current behavior, using a lowercase letter (other than one which might be a lowercase roman numeral, like "i"!) should result in lowercase-alpha markers, etc.


isn't that an implementation issue? your example doesn't work indeed in the StackEdit link, but

1. Item one

1. Item two

   1. Subitem a

   1. Subitem b
does work, so that let me think that you just need to improve the parser to consider "a b c" as a valid ordered list, and maybe "i ii iii" at the same time?

(I replaced a, b and 2 by 1 to force the automatic numbering)


Yes, that would be nice if it parsed correctly. I need ordered lists that have capital letters, capital roman numerals, lowercase letters, numbers, and lowercase roman numerals.


In all legal documents we work with, "legal numbering" is like 1.2.1.3. Here's CSS for that:

http://lane.net.nz/blog/dave/creating-legal-list-numbering-o...

For your Digits, Roman Numerals, and Alpha numbering (mixed symbols), here's CSS for that:

http://css.wikidot.com/cssnippet:easy-outline

Use Markdown to make your list's HTML, use CSS to style it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: