Support content in MDX format
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 746
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 3
Description
Is your feature request related to a problem? Please describe
Other frameworks for authoring static content such as Docusaurus, Vuepress/Vitepress, or Astro.JS use either MDX or a format that is very similar to it. The biggest difference from the Markdown extensions Nuxt Content uses is that components are written using angle brackets (<>...</>) instead of double colons :: ... ::. This makes transitioning to Nuxt more annoying, especially as a simple regex is not sufficient. (Nesting is handled differently, and both Docusaurus and Vitepress support callout containers using triple colons which would conflict.)
Describe the solution you'd like
Support mdx files in addition to md files.
Describe alternatives you've considered
Update the current parser to use angle brackets instead of colons.
This would certainly work too (and e.g. Vitepress still uses the .md extension though it is very close to MDX) but would break existing sites so it should only be done on a major version update. Alternatively this could be made configurable but using .mdx files seems like a simpler solution for now.
Additional context
I do not know the exact flow in which markdown is parsed, transformed and rendered in content though there exists a remark-mdx plugin. However, I am not sure if it is easily injectable into Nuxt Content based on the order in which all other transformations/plugins are executed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing Nuxt Content's markdown parsing, transformation, and rendering pipeline, then investigate whether the mentioned remark-mdx plugin can be injected without disrupting existing transformations. Done means .mdx files are supported alongside .md files while existing Markdown and MDC syntax continues to work, with coverage for the new format.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown, typescript
- Domain
- content
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100