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

Wrapping Directives & Roles #6

Closed rowanc1 closed 2 years ago

rowanc1 commented 2 years ago

Add processed flag to directive.

Directives wrap other FlowContent.

Define a transform --> This should lift all children out of the directives.

fwkoch commented 2 years ago

I don't think we need the processed flag - the MyST AST represents the point when the entire document is parsed (including nested parsing) and before any further transforms have occurred. This means directives are always processed and the processed flag would always be true.

Also, if the directive is unknown, it is still "processed" - it just doesn't have any children.

fwkoch commented 2 years ago

And another minor thing: directives need to at least wrap PhrasingContent in addition to FlowContent. For example, we have an image directive that contains an image (phrasing) node.

rowanc1 commented 2 years ago

In looking through this again, I tend to agree that the additional flag is overkill. I think that there are a number of undocumented pieces in an implementation that are going to be like this that don't need to make it down to the "spec" of defined properties. These should mostly be the things that are necessary to render downstream and are absolutely required.