-
-
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] New config format with runtime variable support! #6653
Conversation
🦋 Changeset detectedLatest commit: b51d9a6 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 |
268a99b
to
13172f2
Compare
} else if (isCapitalized(node.name)) { | ||
throw new MarkdocError({ | ||
message: `Unable to render ${JSON.stringify(node.name)}.`, | ||
hint: 'Did you add this to the "components" prop on your <Content /> component?', | ||
}); |
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.
Bye bye wacky error handling 👋
]); | ||
}); | ||
|
||
it('renders content - simple', async () => { |
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.
Render tests and fixtures moved to a separate render.test.js
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.
Uh, I had only one review comment... and it's praise! 🎉
(Am I slipping....?) Great job with the docs, Ben! 🟣
const entry = await getEntryBySlug('docs', 'why-markdoc'); | ||
const { Content } = await entry.render(); | ||
--- | ||
Use tags like this fancy "aside" to add some *flair* to your docs. |
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.
You caught Sarah in the right mood. Flair approved! 💅
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.
Thought I could get away with some flair in the example code 😉
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.
Looks good 👍
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.
Nice @bholmesdev 💜, docs LGTM!
I really love this new API. Sorry I couldn't give feedback earlier, but just wanted to confirm:
|
Thanks @FredKSchott! Discussed offline, but I'll summarize here:
|
Changes
Markdoc.BIG.IMPROVEMENTS.mp4
astro.config.mjs
to a newmarkdoc.config.mjs
components
property from the<Content />
component. Components can now be imported from themarkdoc.config.mjs
and applied to therender
property directly. No need for magic string mapping anymore 👏@astrojs/markdoc
: esbuild for processing themarkdoc.config
,kleur
for formatted loggingContent
component. These variables can be passed as props:This example
name
variable is available as$name
:Testing
Docs