Customizing Markdown & MDX
CONCEPTS:Markdown & MDX Extensibility
Question Variations
- "How do you add a Remark plugin to your Astro config?"
- "Explain the difference between Remark and Rehype."
- "How do you replace all standard `<img>` tags in MDX with a custom `<Image />` component?"
- "Can you access the Table of Contents (TOC) of a Markdown file in your layout?"
Why This Is Asked
Astro is the premier choice for documentation and content sites. This question tests your ability to extend the content pipeline beyond the defaults to support custom requirements like auto-generated IDs, code highlighting, or interactive charts.
Key Concepts
- Remark Plugins: Transforming Markdown content (AST).
- Rehype Plugins: Transforming the generated HTML.
- MDX Components: Mapping HTML elements to custom Astro components.
- Frontmatter Injection: Adding properties to a page’s frontmatter during the build.
Question Variations
- “How do you add a Remark plugin to your Astro config?”
- “Explain the difference between Remark and Rehype.”
- “How do you replace all standard
<img>tags in MDX with a custom<Image />component?” - “Can you access the Table of Contents (TOC) of a Markdown file in your layout?”