Repository navigation
feat!: add the quarto-definition-list describe format - #114
Merged
Merged
Conversation
When a list item began with a nested list, the writer ended the marker line empty and started the nested list on the next one. Pandoc and CommonMark accept that, but q2 rejects an empty marker line followed by a list. Write the nested list after the marker instead (`- - a`).
Add `DescribeFormat::QuartoDefinitionList` (CLI and config value
`quarto-definition-list`), which writes `\describe{}` lists as Quarto's
`::: {.definition-list}` div. Quarto 1.11.7+ and q2 render it as a
definition list.
The mdast keeps the semantic `DefinitionList` node; only the syntax
differs. `WriterOptions` gains `definition_list_syntax`, and the
describe format maps to it in one place, used both by the document
writer and by Arguments cells, which are rendered during conversion.
In the div form each item is the term followed by a one-item bullet
list with the description. Descriptions of one term are merged, an
empty description becomes a zero-width placeholder so Quarto still
recognizes the item, and a list without terms writes nothing.
Pipe-table cells keep flattening definition lists as before.
The Quarto div form merged all descriptions of one term into a single nested item, so two `DefinitionDescription` nodes became two paragraphs of one definition. Quarto documents several definitions of a term as several nested items, and both Quarto 1.11 and q2 render each as its own `<dd>`. Write one nested item per description.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add the
quarto-definition-listdescribe format, which writes\describe{}lists as Quarto's::: {.definition-list}div:Quarto 1.11.7+ and q2 render it as a
<dl>. The default stayspandoc-definition-list; switching the default, and pointing the deprecateddefinition-listvalue at this format, are left for follow-ups.Design
DefinitionListnode; only the syntax differs.WriterOptionsgainsdefinition_list_syntax(Pandocby default, orQuartoDiv), and no newNodevariant is added, so AST JSON and mdast consumers are unaffected beyond the new field.DescribeFormat::definition_list_syntax()maps the describe format to the writer syntax in one place. It is used by the document writer and by Arguments cells, which are rendered during conversion.<dd>.​, so Quarto still recognizes the item.Also fixed
When a list item began with a nested list, the writer left the marker line empty and started the list on the next line. q2 rejects that form; the nested list now starts on the marker line (
- - a). This shape is common in the new format (a description holding only a list). Output of the existing describe formats is unchanged on the man pages of several real packages (3558 files).Verification
<dl>elements.<dl>per div in 31 of them. q2 cannot render the other 6 because of unrelated quote parse errors (Q-2-7 / Q-2-11) that occur onmainwith the Pandoc format too.Breaking changes
DescribeFormatgainsQuartoDefinitionList.WriterOptionsgainsdefinition_list_syntax; struct literals need the field or..Default::default().