diff options
Diffstat (limited to 'docs/src/pages')
-rw-r--r-- | docs/src/pages/en/guides/markdown-content.md | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/docs/src/pages/en/guides/markdown-content.md b/docs/src/pages/en/guides/markdown-content.md index 8233a8af4..b5e33d5b2 100644 --- a/docs/src/pages/en/guides/markdown-content.md +++ b/docs/src/pages/en/guides/markdown-content.md @@ -33,7 +33,6 @@ In addition to custom components inside the [`<Markdown>` component](/en/guides/ - [GitHub-flavored Markdown](https://github.com/remarkjs/remark-gfm) - [remark-smartypants](https://github.com/silvenon/remark-smartypants) - [rehype-slug](https://github.com/rehypejs/rehype-slug) -- [Prism](https://prismjs.com/) Also, Astro supports third-party plugins for Markdown. You can provide your plugins in `astro.config.mjs`. @@ -85,6 +84,27 @@ export default { }; ``` +### Syntax Highlighting + +Astro comes with built-in support for [Prism](https://prismjs.com/) and [Shiki](https://shiki.matsu.io/). By default, Prism is enabled. You can modify this behavior by updating the `@astrojs/markdown-remark` options: + +```js +// astro.config.mjs +export default { + markdownOptions: { + render: [ + '@astrojs/markdown-remark', + { + // Pick a syntax highlighter. Can be 'prism' (default), 'shiki' or false to disable any highlighting. + syntaxHighlight: 'prism', + // If you are using shiki, here you can define a global theme. + shikiTheme: 'github-dark', + }, + ], + }, +}; +``` + ## Markdown Pages Astro treats any `.md` files inside of the `/src/pages` directory as pages. These files can contain frontmatter, but are otherwise processed as plain markdown files and do not support components. If you're looking to embed rich components in your markdown, take a look at the [Markdown Component](#astros-markdown-component) section. |