jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
219 stars 64 forks source link

🏗 Support parts as external files and in the site config #1586

Closed fwkoch closed 1 month ago

fwkoch commented 1 month ago

This PR addresses part of this issue: https://github.com/jupyter-book/mystmd/issues/1246 - specifically,

Allow frontmatter part to be a file

Modify behaviour of in-line frontmatter parts be processed as a "pseudo-file" rather than injected into the page tree

Allow site to define parts

Update static export templating logic and extractPart for new part definition locations

The parts of that issue that are not yet addressed in this PR are

Allow exports to define parts

Update site templating logic to respect parts in template.yml

~Additionally, project-level parts are still valid, but are not processed in the same way as page or site parts (i.e. they are still left as text in-line in the frontmatter)~ This PR has been updated so project-level parts are processed to mdast/frontmatter objects, as suggested in the review.

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: 87a97c6f443eeb0ff5970cd042c96cc64e1dc911

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages | Name | Type | | ---------------- | ----- | | myst-to-jats | Patch | | myst-common | Patch | | myst-cli | Patch | | myst-spec-ext | Patch | | myst-frontmatter | Patch | | myst-config | Patch | | jats-to-myst | Patch | | mystmd | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

fwkoch commented 1 month ago

Before merging, we should also process project parts the same way as site parts, even though they are unused everywhere (except the CFF export...)

rowanc1 commented 1 month ago

For the myst.json.parts --> we should move to frontmatter and mdast rather than just the ast as a child, this allows us to have a bit more flexibility in the future.