jupyter-book / myst-spec

MyST is designed to create publication-quality, computational documents written entirely in Markdown.
https://mystmd.org/spec
MIT License
14 stars 6 forks source link

✨ NEW: Add fields `enumerated` and `enumerator` to containers, math, headings #36

Closed fwkoch closed 2 years ago

fwkoch commented 2 years ago

This PR is to address numbering of different node types upon render, when authors want sequential figure / table / equation / header numbers (as can be done in latex / pandoc / sphinx). While numbers themselves will be added after the fact as a transform on the AST, we do need to specify if nodes should be numbered.

Previously, we had a small start at this: containers had an optional numbered property. This PR adds that property to headings and math and also makes it required (with an implied default of true).

chrisjsewell commented 2 years ago

makes it required (with an implied default of true).

Why does this need to be required? I don't think this should be the case. Definitely +1 for having it in the schema 👍, but I think processors of the AST can decide what the implied default is, probably via configuration available to the user

chrisjsewell commented 2 years ago

In general, I would say that most fields that are boolean, should also be allowed to be undefined. This is true of other things in mdast, such as List.ordered and List.spread