-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Description
Is your feature request related to a problem? Please describe.
I want to render the raw markdown that is processed inside vitepress. I can use createMarkdownRenderer
and renderInline
, but the @includes
content is not imported. I want to include the processed markdown, including any markdown-it
and @include
evaluation, as a build asset for my VitePress site.
Describe the solution you'd like
I found a way to do this using the internal processIncludes
method, if it was exported that would make this code easy to implement:
buildEnd: async (config: SiteConfig) => {
const mdR = await createMarkdownRenderer(config.srcDir, config.markdown, config.site.base, config.logger)
const file = `${config.srcDir}/markdown-examples.md`
const md_raw = await readFile(file, 'utf-8')
const md_src = processIncludes(config.srcDir, md_raw, file, [])
console.log("md", mdR.renderInline(md_src))
}
I had to manually copy the function from the compiled code, but it works and would be useful.
Describe alternatives you've considered
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the docs.
- Read the Contributing Guidelines.
- Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
No labels