-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
better defaults for nested ordered lists (distinguish sublist numerals from parent list numerals) #227
Comments
The format of an ordered list can be specified by the type= attribute, please see RFC 7991: The "xml2rfc" Version 3 Vocabulary. I think what you are asking is a way for the outer list to be parametrized to supply a type= attribute for any inner list, so it does not have to be repeated for each inner list. It would be easy to add something like |
@cabo if there is a way to do that from kramdown-rfc, that would be great. You mention it as a way to parameterize the outer list itself, which would definitely be useful. Even more useful (and simple, for my purposes) would be a document-wide setting that applies to all nested, ordered lists. What i would like ideally is something in the YAML metadata block like:
which would make the top-level ordered list |
Will the code need to consider intervening unordered lists? Or can we start at 1 again if that happens?
|
Those types can contain spaces, so a space-separated list won't work too well. Probably needs to be
|
I don't have much of an opinion here -- that seems pretty weird to me, if i'm doing nested ordered lists it's probably because i want to be able to refer to a particular sub-sub-*-item by its coordinates (e.g., "clause 3(b)iii", the way people talk about US legislation) , and i don't see how an intervening unordered list would fit in here. I'd be fine with any of the following three choices:
|
OK, implementation-wise your number 1 (see what I did here :-) seems easiest. |
Is there a reason why we're not trying to follow what would happen from CommonMark? CommonMark puts out HTML, but we can follow how it does levels and nesting instead of inventing our own way. |
On 19. Apr 2024, at 19:33, Paul Hoffman ***@***.***> wrote:
Is there a reason why we're not trying to follow what would happen from CommonMark?
Yes.
Kramdown-rfc is based on kramdown, which is a dialect that was formed before common mark made decisions, often incompatible with existing markdown dialects.
In the hierarchy of objectives for kramdown-rfc, stability is very high, because I-Ds are often “dusty decks” that should continue to work after periods of time that are natural in the IETF, e.g., half a decade.
Where these considerations do not get in the way (and adding a YAML control certainly doesn’t), we can innovate.
CommonMark puts out HTML, but we can follow how it does levels and nesting instead of inventing our own way.
As far as I know, commonmark doesn’t do anything useful in the area of labeling nested ordered lists, or actually even in the way of supporting different numbering styles for single-level lists.
RFCXMLv3 has type=, so we are covered by using an IAL.
What is proposed here is to add some automation that would generate this attribute.
(Commonmark does do one thing that doesn’t have to do with nesting, which is extracting start numbers — that would be a great feature to have, but unfortunately it won’t be part of kramdown [1].
Well, we do have the start= attribute in RFCXMLv3 as well, and that can be addressed with an IAL, as can be group= for continuing numbering across interruptions.
Commonmark also has a broken [2] concept of tight vs. loose lists.
RFCXMLv3 has spacing=, which again can be accessed via an IAL.)
Grüße, Carsten
[1]: gettalong/kramdown#211
[2]: jgm/djot#138
|
I have written the code, but Will push this anyway after some more testing. |
Now in 1.7.9: 1.7.9 Add option nested_ol_types Set globally in The value needs to be an array of <ol type= values, expressed as one of:
When testing this, an HTML rendering issue might cause some confusion: |
1.7.10 now also takes nested_ol_types from YAML kramdown_options As in
(overridden by ::options and by pseudo-attribute on <ol) |
1.7.11 now also takes an option ol_start_at_first_marker As in
Default: false (for kramdown-rfc backward compatibility) If (This increases commonmark compatibility, see #227 (comment)) |
I think the recent changes should address both the original observation and the discussion, so please close this if this works for you. |
Nice -- a solution is on its way in ietf-tools/xml2rfc#1123 |
This works great. Thank you, @cabo! Much appreciated. |
When describing an ordered sequence of steps (e.g., in pseudocode in a draft), it's nice to present them as an ordered list (e.g. 1,2,3,4) rather than unordered (just bullets). However, if there are sub-steps in such a presentation, the natural way to present them is with a nested ordered list. But the nested list restarts with same numbering scheme as the outer list, which is pretty confusing.
For example, this text:
renders as:
Here are two better ways that it could render:
or
The text was updated successfully, but these errors were encountered: