mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-19 12:07:00 +02:00
* add some initial i18n doc * i18n doc progress * i18n tutorial progress * i18n tutorial progress * polish Crowdin docs * i18n sidebar in guides * polish crowdin doc * update Crowdin doc a bit * fix annoying relative link to global site resource in template (breaks i18n tutorial) * template: use simpler export for homepage * add markdown page example * rename mdx.md to interactiveDoc.mdx * update bootstrap/facebook templates too * sync init template package scripts * add slug frontmatter doc * improve i18n doc * complete i18n doc * temporarily enable the localeDropdown * doc typo * improve the i18n doc * Add Git i18n doc * add missing "--" for npm run options (unfortunately they don't get stripped by npm2yarn, and are required foor npm) * improve a bit the Crowdin doc
27 lines
690 B
Text
27 lines
690 B
Text
---
|
|
id: mdx
|
|
title: Powered by MDX
|
|
---
|
|
|
|
You can write JSX and use React components within your Markdown thanks to [MDX](https://mdxjs.com/).
|
|
|
|
The `.mdx` extension is not required, but will enable better support from tooling (IDE, Prettier...).
|
|
|
|
export const Highlight = ({children, color}) => (
|
|
<span
|
|
style={{
|
|
backgroundColor: color,
|
|
borderRadius: '2px',
|
|
color: '#fff',
|
|
padding: '0.2rem',
|
|
}}
|
|
onClick={() => alert('Highlight pressed!')}>
|
|
{children}
|
|
</span>
|
|
);
|
|
|
|
<Highlight color="#25c2a0">Docusaurus green</Highlight> and <Highlight color="#1877F2">
|
|
Facebook blue
|
|
</Highlight> are my favorite colors.
|
|
|
|
I can write **Markdown** alongside my _JSX_!
|