mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 10:17:55 +02:00
tutorial: explain .mdx better
This commit is contained in:
parent
8ab654d028
commit
bc680e280a
3 changed files with 10 additions and 2 deletions
|
@ -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.
|
||||
|
|
|
@ -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`
|
||||
|
|
|
@ -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/):
|
||||
|
|
Loading…
Add table
Reference in a new issue