📩 Import/Export API specs/formats
Docusaurus supports the Markdown syntax and has some additional features.
Front Matter#
Markdown documents can have associated metadata at the top called Front Matter:
---id: my-doctitle: My document titledescription: My document descriptionsidebar_label: My doc---
Markdown contentMarkdown links#
Regular Markdown links are supported using url paths or relative file paths.
Let's see how to [Create a page](/create-a-page).
Markdown images#
Regular Markdown images are supported.
Add an image at static/img/docusaurus.png and use this Markdown declaration:
Code Blocks#
Markdown code blocks are supported with Syntax highlighting.
```jsx title="src/components/HelloDocusaurus.js"function HelloDocusaurus() { return ( <h1>Hello, Docusaurus!</h1> )}```src/components/HelloDocusaurus.js
function HelloDocusaurus() { return <h1>Hello, Docusaurus!</h1>;}Admonitions#
Docusaurus has a special syntax to create admonitions and callouts:
:::tip My tip
Use this awesome feature option
:::
:::danger Take care
This action is dangerous
:::My tip
Use this awesome feature option
Take care
This action is dangerous
React components#
Thanks to MDX, you can make your doc more interactive and use React components inside Markdown:
export const Highlight = ({children, color}) => ( <span style={{ backgroundColor: color, borderRadius: '2px', color: 'red', padding: '0.2rem', }}> {children} </span>);
<Highlight color="#25c2a0">Docusaurus green</Highlight> and <Highlight color="#1877F2">Facebook blue</Highlight> are my favorite colors.