md vs mdx
md import pipeline renders to html, mdx import pipeline renders to .js/.ts/.jsx... which allows to customize html tags with Astro components.
goal
I would like to take advantage of the mdx power in .md files with Astro
what I tried
tried to configure mdx integration in Astro but it is excluding .md extension unfortunately to allow default md rehype pipeline
My workaround of renaming all .md files to .mdx is very intrusive (changes files meta data) I would like to find a different approach
forking mdx integration is hard to maintain
I started a vite plugin that changes .md ids to add an x as .mdx, then I had to write my own loader, then it got too complex
astro-remote only takes some default components and does allow to replace any custom component
examples
I would like to avoid
- (-) embedding svg assets in config files to e.g. add link icons in headings elements (example https://github.com/withastro/docs/blob/52bf88ec74e3d01d212808d678320f190be64f76/astro.config.ts#L16)
and rather
- (+) allow advanced enhancements written in html like e.g. .astro and NOT in rehype js format. (example just for reference in mdx not md https://github.com/MicroWebStacks/astro-big-doc/blob/9d4215e86c020bf72f28ce83d8e494df23e0ff7d/src/components/headings/H1.astro#L15)
Any ideas of the finest approach to achieve this, it feels like this last step is missing to unleash Astro's power over Markdow !!!
references
astro remote : https://github.com/natemoo-re/astro-remote
using old or deprecated options such as the previous
<Markdown />
tag, might be an option to explore but should not result in separate feature branch where most of new features have to be manually maintained.programmatic component creation https://github.com/withastro/astro/blob/main/packages/astro/test/units/render/jsx.test.js#L33-L35