Closed hmdne closed 5 months ago
Here, we have some issue. Some level 4 paragraph has no number. I'm adding a comment FIXME for editor to correct.
This is very useful.
Can we merge this?
Please take a look at my comment on https://github.com/metanorma/coradoc/issues/69#issuecomment-2140888768
If that's good enough for you, then feel free to merge.
If that's good enough for you, then feel free to merge.
Is this in line with Asciidoctor syntax? If so we can merge. Thanks.
@ronaldtse I found no mention of [level]
in AsciiDoc syntax. And AsciiDoctor itself doesn't support it. So, merging that would make HTML's H5 and H6 equivalent to H4 in non-extended implementations.
@ronaldtse To be entirely clear, ======
is a correct syntax according to AsciiDoctor and their reference document. =======
is not. The first is compiled by AsciiDoctor into <h6>
and is generated from <h5>
in the current version of reverse_adoc. The second is generated from <h6>
in the current version of reverse_adoc but is not accepted by AsciiDoctor. This PR would change both <h5>
and <h6>
into a new syntax:
[level=x]
===== something
Therefore it will now return correct AsciiDoc for <h6>
encountered in document, but would break compatiblity with AsciiDoctor on <h5>
(because it can't parse [level] property, so since this patch it would generate headings one level lower for this particular tag).
@hmdne we want to be compatible with Asciidoctor, so h6 goes to 6 equal signs and vice versa. Thanks.
I believe “level” is an Metanorma extension to support deeper clauses. The application of level is necessary for us to support users.
So, I will amend this PR to handle levels>=6 ("<h7>
"+ which doesn't exist with HTML, but let's say custom documents could generate it) as:
[level=7]
====== Title
And also to correct what I extracted from your comment into #79 . This would also handle the incoming document to generate at most ======
(level5) and generate no [level]
clauses since it contains no levels higher than that.
@hmdne agreed. Thanks.
Usage of [level=*]
in Metanorma is described here:
I've updated the code here (3a27873) to only add level beyond 6 equal signs.
@hmdne can you review and see if it's good to merge? I might be missing something.
@ronaldtse LGTM
This fixes #69 and fixes #66. This does fix NOT #65.
Excerpts from a diff of our incoming document (please don't miss my comment for the second excerpt):
Here, we have some issue. Some level 4 paragraph has no number. I'm adding a comment FIXME for editor to correct.
Metanorma PR checklist