-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Markdoc] headings
and heading IDs
#7095
Conversation
🦋 Changeset detectedLatest commit: 11c388f The changes in this PR will be included in the next version bump. 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ship it! 🚢
Just a quick heads up @bholmesdev that I literally saw this merge as I was looking at the README! Reminder for next time! ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Late to the party (whomp, whomp) but README docs are great! 🎉
@sarah11918 CRAP I 100% forgot to tag you on this 😓 Assumed we'd reviewed it with all the docs PRs flying around. If you want to leave comments here for me to address in a fast follow, happy to do so |
Sorry @bholmesdev - I was prioritizing the specific "merge on release" docs I'd been given (and, didn't know this Markdoc update was something to be released for 2.5) so I assumed this was a "regular" PR, and was just clearing out all the Astro Docs Maintainer pings now. Docs are great though! No worries! |
It is a "regular" PR, was just itching to merge to align Markdoc 0.2.0 with some data collection changes. I'll check next time, my bad! |
Changes
headings
array from therender()
function@astrojs/markdoc/runtime
export that exposes acollectHeadings
utilitygetHeadings()
function to all.mdoc
modules. This approach will call transform twice (once for the Content component, once forgetHeadings()
). This is due to a fundamental limitation of allowing Markdoc variables as component props. A TODO for a future exploration is noted in the source code.defaultNodes
object to use when modifyingnodes
from the Markdoc configTesting
Docs
Update Node headings example in the README. In the future, we may need to document each node case-by-case!