nuxt / nuxt/content

Support content in MDX format

Open
#2,498 11 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.