Skip to content

Custom processing option for mdx loader #2134

Discussion options

You must be logged in to vote

Heya @benjaminpreiss!
Exciting to see progress towards multiple documents in a file.
Using comments to provide metadata for the sections is interesting, could be a valuable addition.

I'd second @wooorm's comment

Regexing files and injecting JS-like things as strings seems like a fragile way to go about it

This feels like something which may be better served working off of a syntax tree.
Whether that be the initial markdown AST (MDAST/remark), the intermediate HTML AST (HAST/rehype), or the final JavaScript AST (ESAST/recma).
Which mdx already supports plugins for (https://github.com/mdx-js/mdx/tree/main/packages/mdx#optionsremarkplugins) which could make generating a proof of concept ea…

Replies: 6 comments 12 replies

Comment options

You must be logged in to vote
2 replies
@benjaminpreiss
Comment options

@ChristianMurphy
Comment options

Answer selected by ChristianMurphy
Comment options

You must be logged in to vote
2 replies
@benjaminpreiss
Comment options

@wooorm
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@wooorm
Comment options

@remcohaszing
Comment options

@benjaminpreiss
Comment options

@remcohaszing
Comment options

Comment options

You must be logged in to vote
2 replies
@benjaminpreiss
Comment options

@karlhorky
Comment options

Comment options

You must be logged in to vote
2 replies
@wooorm
Comment options

@benjaminpreiss
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
5 participants