Skip to content

Commit

Permalink
Added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanM04 committed Jan 29, 2022
1 parent 60b3cca commit 7cf77e3
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion docs/src/pages/en/guides/markdown-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 7cf77e3

Please sign in to comment.