#Can i add more custom markdown syntax ? Like :::tip :::danger
1 messages · Page 1 of 1 (latest)
Hi @patent crag. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Astro uses Starlight's custom Markdown syntax for rendering asides, which are blocks of content indicated using a pair of triple colons :::. The types of asides currently supported are note, tip, caution, and danger source (https://starlight.astro.build/guides/authoring-content/#asides).
However, the provided sources do not specify a way to create custom aside types like :::do and :::dont.
Astro does support adding third-party remark and rehype plugins for Markdown, which allow you to extend your Markdown with new capabilities source (https://docs.astro.build/en/guides/markdown-content/#adding-remark-and-rehype-plugins). You might be able to find or create a plugin that allows for additional custom syntax.
If you want to extend the Markdown capabilities, you can add remarkPlugins or rehypePlugins in your Astro config file. Here's an example of how to do it:
import { defineConfig } from 'astro/config';
import remarkToc from 'remark-toc';
import { rehypeAccessibleEmojis } from 'rehype-accessible-emojis';
export default defineConfig({
markdown: {
remarkPlugins: [ [remarkToc, { heading: 'toc', maxDepth: 3 } ] ],
rehypePlugins: [rehypeAccessibleEmojis],
},
});
source (https://docs.astro.build/en/guides/markdown-content/#adding-remark-and-rehype-plugins)