tc39 / ecmarkdown

A shorthand language for writing ECMAScript-style algorithms, inspired by Markdown

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ordered list (alg. fragment) begins with non-decimal item number

jmdyck opened this issue · comments

Lists are written as a series of lines, each starting with either a number, e.g. 1., or a star, e.g. *.
The first list item's number determines the starting number in the output (via <ol start="x">);

The latter feature can handle algorithm fragments such as those in

However, consider the fragments in

  • 20.1.3.2 (alternative step12.b.i) and
  • B.3.5 (alternative step 5.d.ii.2.a.i)

where the step(s) of the fragment are labelled by roman numerals, not decimals. Could a feature be added to handle such cases?

I suppose it might have to be added to ecmarkup, e.g. <emu-alg type="i"> (converting to <ol type="i">).

I think this can be handled with CSS styles in the meantime but I think this would be an emu feature as you suggest. Can't imagine wanting a shorthand syntax for this...

This is kind of interesting as I think ideally the output should not be "i. blahblahblah" but instead "12.b.i. blahblahblah". But maybe don't tackle that yet...

Emu feature seems reasonable. I'd suggest level="3" or startinglevel="3" instead of type="i", since the latter requires a mental map from indent levels to formatting.

Alternately we could allow EMD to handle this (e.g. allowing a. blahblah to start a level-2 list, and i. blahblah to start a level 3 list), but it's kind of hairy, especially since both i and a are in the same alphabet.

I refuse to implement this in EMD :-P. I think level is the right primitive here (though I agree with your opening sentence, it's blowing my mind atm :-P)

I'm going to close this as fixed by tc39/ecmarkup#217, which automatically adjusts the bullet style based on the step being replaced.