Modify ordered-lists and bullet pointers in markdown-writer package


#1

How can I modify markdown-writer package settings such that the following two things can be accommodated -

(1) This ordered list is recognized

a.
b.
...

Currently, the only available order list is “1.” sequence.
For this change, I know where to make the change (I have to modify the “ol” section under linestyles or add an new entry in config.cson of markdown-writer). But I have no clue what to do…

Now, would this modification make a particular theme syntax (I am using one light) highlight "a. " as it highlights "1. "? Or should I make changes to style.less?

(2) In unordered list, is it possible to get different bullet markers when tab is pressed
For example, say, I have this list

+ first line
+ second line

In this, I go back to the first line and hit enter and tab, I get something like this

+ first line
     + 
+ second line

But I want something like this -

+ first line
     * 
+ second line

Thanks for any suggestions :slight_smile:


#2

When asking about a specific passage, it’s nice to include a link to the package so that people don’t have to go searching for it before they can help you.

To recognize a letter sequence, you want the following code:

markdown-writer:
  linestyles:
    ol: before: "a. ", regexBefore: "(?:-|\\*|\\[a-zA-Z]\\.)\\s"

The above is according to this page.

In unordered list, is it possible to get different bullet markers when tab is pressed

Looking through the package’s documentation, it does not appear to be capable of that.


#3

Thanks for that! But this does not seem to work for me.

(1) Probably I am not putting it in the right place. I tried first putting it in atom’s config.cson. I also tried mdwriter.cson in the project folder. But none of these gave the subsequent “b.” after I have typed "a. " and press enter.

(2) And, a clarification (and which might be related to why I am not getting this to work). Can there be two “ol” blocks in linestyles section? Because I want both “1.” and “a.” functionality so that I can have something like this

1. first line here
    a. sub line has different numbering
2. and the second line

Interestingly, when I replaced the “ol” block for “1.” with that of “a.”, the numbered ordered list was still working (and alphabet list was still non-effective).

Any suggestions on how I can make this work?

Thanks again!


#4

Nope, I’ve tried everything and then I looked at the code and the ol bit only handles numbers, not letters. So nevermind my previous optimism.

It just occurred to me that markdown doesn’t even support alpha-indexed ordered lists (GFM doesn’t, either). Markdown doesn’t, but ASCIIDoc does. Unfortunately, there’s not a package to auto-continue lists for ASCIIDoc.


#5

Sigh! I was optimistic about this.
The reason I thought it was possible because I had observed similar behaviour (both the two behaviours I mentioned in the initial query) in sublimetext with the package MarkdownEditing.

Anyways, thanks for the help :slight_smile:


#6

Oh, it’s possible, but that package won’t do it for you.

Changing the ul decoration when you press Tab should be easy. You would just have to listen for an event associated with the key being pressed, then see if the line matches a regular expression that looks like a list.

The ASCIIDoc Preview package already knows how to track ordered lists with multiple different decorations.