From: Lady Date: Sat, 20 Sep 2025 04:51:30 +0000 (-0400) Subject: Improve/adjust note/sectioning elements X-Git-Tag: 0.6.0~1 X-Git-Url: https://git.ladys.computer/LesML/commitdiff_plain/8efc09cdae80baf04d15c9b1c0db38cd3a868584?ds=sidebyside;hp=5c6c7daa10f7c1ab2074a21fbb2886bcc0f83a7c Improve/adjust note/sectioning elements - Notes are now `
`s, not `
`s. - A new “abstract” section type has been added. - Sections can now contain list items (with a level > 1). - The `LesML:finalize-footnotes` stage has been repurposed into a more general `LesML:finalize` stage, in part to facilitate the above. - Paragraph i·d¦s are now passed upwards to the containing element in all cases, when applied to the first paragraph in a container. To literally assign an i·d to the first paragraph, add an empty initial paragraph (just a `¶`), which will be dropped. The same is true for language tags. It would be nice to be able to specify titles/labels for sections, but there isn¦t a good mechanism for doing this as of now. The heading sigils are probably inappropriate for this, as headings in sections are conceptually singular and “unleveled”. There is no need for four heading types when a section can only contain one heading and it must always be the first paragraph. But on the H·T·M·L side, section headings _should_ have appropriate levels corresponding to their position in the document. So this would need to be remediated somehow. --- diff --git a/README.markdown b/README.markdown index 35f5a53..99ff8ba 100644 --- a/README.markdown +++ b/README.markdown @@ -60,7 +60,8 @@ The lines, minus this leading, are then re‐analysed. Bracketed paragraphs which end quotes are treated as captions (``); otherwise, they are footers (``). -Non·empty paragraphs are classified as follows :⁠— +Non·empty paragraphs (which, to be clear, may still result in empty + `` elements) are classified as follows :⁠— - If the paragraph consists of only the following section‐break characters, plus any amount of white·space, then it is @@ -113,9 +114,9 @@ Non·empty paragraphs are classified as follows :⁠— - Otherwise, the paragraph is ordinary. After this classification, each ordinary paragraph is further - classified by type based on its first character (which is must be - followed by white·space, a pilcrow, or else the only thing on the - line) :⁠— + classified by type based on its first character (which must be + followed by white·space or a pilcrow, or else be the only thing on + the line) :⁠— - If the paragraph is preformatted, it is an ordinary paragraph. @@ -155,19 +156,22 @@ After this classification, each ordinary paragraph is further secondary, and tertiary list items which precede them. - If the paragraph begins with `※`, it is an ordinary note - (``). + (``). - If the paragraph begins with `☡`, it is a cautionary note - (``). - -- If the paragraph begins with `🛈`, it is an informative note - (``). + (``). - If the paragraph begins with `⯑`, it is a questioning note - (``). + (``). + +- If the paragraph begins with `@`, it is an abstract + (``). -- If the paragraph begins with `⚠︎`, it is a warning note - (``). +- If the paragraph begins with `🛈`, it is a (informative) tip + (``). + +- If the paragraph begins with `⚠︎`, it is a (warning) notice + (``). - If the paragraph begins with `^`, it is a footnote (``). @@ -204,6 +208,17 @@ The characters following the `¶` give the identifier for the paragraph, This may be suffixed with a language tag beginning with `@` and terminated with `$`. +When a paragraph produces an `` element “wrapped in” another + kind of element (e·g, a blockquote, section, or list item), the + identifier and language of the first paragraph are applied to the + wrapping element. +If the first paragraph has no other contents, it is deleted. +To apply the identifier or language to the `` element itself, + and not its wrapper, one can simply make the first paragraph empty + (using a literal `¶` with no other contents). +This paragraph will be dropped, but the following paragraphs will still + be processed as non·initial. + The remaining characters in a paragraph form its contents. Markup within paragraphs is delimited with·out exception by pairs of characters, with the following precedence :⁠— @@ -266,10 +281,12 @@ Once the tree is built as above, it is remediated into its final form by the following steps :⁠— - Continuation paragraphs are joined with the preceding list items or - divs. + sections. - List items of a higher level are nested in preceding list items, when present. + List items of a level greater than 1 can also be nested in preceding + sections (notes, abstracts, ⁊·c…). - Successive list items of the same level and class are joined into a single list. diff --git a/parser.xslt b/parser.xslt index 5164ea1..a304a46 100644 --- a/parser.xslt +++ b/parser.xslt @@ -13,7 +13,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one --> - + @@ -422,7 +422,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one body - + @@ -432,7 +432,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one doc-endnotes - + @@ -690,13 +690,13 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one - - + + note - info + note @@ -705,13 +705,13 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one - - + + note - query + caution @@ -720,13 +720,13 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one - - + + note - warn + query @@ -735,13 +735,10 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one - - + + - note - - - note + doc-abstract @@ -750,13 +747,22 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one - - + + - note + doc-tip - - caution + + + + + + + + + + + doc-notice @@ -840,22 +846,12 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one - -