Closed wooorm closed 3 years ago
@ChristianMurphy Do you see the default being detect
as a good idea? I think so
/cc @remcohaszing @ggoodman WDYT?
Do you see the default being detect as a good idea?
I think so. :+1: There is an edge case, that being if people use non-standard md and mdx extensions and still want the type to be inferred there isn't a way to override at the moment. But until that use case pops up, YAGNI
There is an edge case, that being if people use non-standard md and mdx extensions and still want the type to be inferred there isn't a way to override at the moment.
The way I’ve set it up now is that there’s two lists of extensions: one for markdown, one for mdx. Folks can overwrite those to set their own funky preferences.
It’s indeed a weird case, but with {mdExtensions: ['.mdx', ...], mdxExtensions: [...]}
one could load .mdx
as markdown, or with {mdExtensions: [...], mdxExtensions: ['.md', ...]}
one could set .md
as MDX. Again, I think it’s really weird, but it’s possible.
I mostly looked at the docs, because although I’ve looked at the internals, I’m not very familiar with them.
Anyway, looks good to me :+1:
Add
format
to support MDX and plain markdownmdx
ormd
based on whether the given file has an extension inmdExtensions
and to handle bothmdExtensions
andmdxExtensions
in integrationsformat: 'md'
to treat input as markdown and to handlemdExtensions
in integrationsformat: 'mdx'
to treat input as MDX and to handlemdxExtensions
in integrationsrehype-raw
evaluate
optionsCloses GH-17.