jupyter-book / mystmd

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

Allow plugins access to the state of all MyST documents #1616

Open choldgraf opened 3 weeks ago

choldgraf commented 3 weeks ago

I was trying to write a custom plugin that returned a list of blog pages in my site, similar to this issue:

However I couldn't figure out (and think it may not be possible) to define a .mjs plugin that can access the information needed to do this.

It would be helpful to enable / document how MyST plugins can access the list of all parsed documents in a MyST build, along with their metadata and/or content.

rowanc1 commented 3 weeks ago

The transforms are currently run per document in parallel, we don't have a hook to do transforms at the end, and thus don't have access to the full project.

In the MEP plugin, we are doing this by reading the YAML in the md frontmatter from the filesystem directly, which is something that would likely work today!