tutorial: explain .mdx better

This commit is contained in:
sebastienlorber 2023-01-05 17:06:21 +01:00
parent 8ab654d028
commit bc680e280a
3 changed files with 10 additions and 2 deletions

View file

@ -44,4 +44,4 @@ The `cd` command changes the directory you're working with. In order to work wit
The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.
Open `docs/intro.mdx` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
Open `docs/intro.mdx` (this page) in a text editor and edit some lines: the site **reloads automatically** and displays your changes.

View file

@ -4,7 +4,7 @@ sidebar_position: 1
# Create a Page
Add **Markdown or React** files to `src/pages` to create a **standalone page**:
Add **Markdown ([MDX](https://mdxjs.com/)) or React** files to `src/pages` to create a **standalone page**:
- `src/pages/index.js` → `localhost:3000/`
- `src/pages/foo.mdx` → `localhost:3000/foo`

View file

@ -6,6 +6,14 @@ sidebar_position: 4
Docusaurus supports **[Markdown](https://daringfireball.net/projects/markdown/syntax)** and a few **additional features**.
:::info
Docusaurus is based on **[MDX](https://mdxjs.com/)**. It allows you to use **[React and JSX](https://reactjs.org/docs/introducing-jsx.html)** in your Markdown documents.
You can use both `.md` and `.mdx` file extensions. We **recommend using the `.mdx` extension by default** and whenever using any advanced feature not included in [CommonMark](https://commonmark.org/): admonitions, tabs, React, JSX...
:::
## Front Matter
Markdown documents have metadata at the top called [Front Matter](https://jekyllrb.com/docs/front-matter/):