erinata / SublimeBullet

This is a Sublime Text plugin for markdown style Bullet points and Number lists. It automatically add * and - for unordered lists, > for blockquotes, and numbered items for number lists.
6 stars 8 forks source link

Support for restructuredText #3

Open bizoo opened 12 years ago

bizoo commented 12 years ago

Do you think that your plugin could be made more generic and work for restructuredText ? Bullet definition are here: http://docutils.sourceforge.net/docs/user/rst/quickref.html#bullet-lists

Thanks to think about it.

erinata commented 12 years ago

Sure!

But I just look at the link you send me, and it seems that restructureText has bullet style very similar to markdown. It's * + - for unordered list, and 1. 2. 3. for numbered list........ Is there any particular list related feature that I missed in restructured Text?

bizoo commented 12 years ago

I don't know MarkDown so I couldn't tell you what's the difference with rst.

Chars for unordered list are: "*", "+", "-", "•", "‣", or "⁃" So nothing special here.

Ordered list are: arabic numerals: 1, 2, 3, ... (no upper limit). uppercase alphabet characters: A, B, C, ..., Z. lower-case alphabet characters: a, b, c, ..., z. uppercase Roman numerals: I, II, III, IV, ..., MMMMCMXCIX (4999). lowercase Roman numerals: i, ii, iii, iv, ..., mmmmcmxcix (4999). suffixed with a period: "1.", "A.", "a.", "I.", "i.". surrounded by parentheses: "(1)", "(A)", "(a)", "(I)", "(i)". suffixed with a right-parenthesis: "1)", "A)", "a)", "I)", "i)".

There is a special char "#" for auto incremented list, Best way to handle it is probably to use it for all subsequent items in the list after the first occurrence of it (1, #, #, # or A, #, # or #, #, # or 1, 2, 3, #, #, #).

erinata commented 12 years ago

Thanks for your explanation. It seems that it's more complicated than markdown.

I will try to implement part of the rules first......let's see how far I can go.

erinata commented 12 years ago

If you are interested, you can try out the new version of Bullet.

There is an option in the Bullet.sublime-settings file and you can enable the restructuretext bullet. (default is false)

I only implemented a few simple rules (unordered lists, and #. ). I will add more in the future.