From 616440622f7562df6bba02e7fdde0325c007c6b5 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 5 Jan 2023 18:05:17 +0100 Subject: [PATCH] tutorial use .mdx --- .../tutorial-basics/markdown-features.mdx | 4 ++-- website/docs/installation.mdx | 23 +++++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/packages/create-docusaurus/templates/shared/docs/tutorial-basics/markdown-features.mdx b/packages/create-docusaurus/templates/shared/docs/tutorial-basics/markdown-features.mdx index 42a94dac74..baa4a27c33 100644 --- a/packages/create-docusaurus/templates/shared/docs/tutorial-basics/markdown-features.mdx +++ b/packages/create-docusaurus/templates/shared/docs/tutorial-basics/markdown-features.mdx @@ -8,9 +8,9 @@ Docusaurus supports **[Markdown](https://daringfireball.net/projects/markdown/sy :::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. +Docusaurus is based on **[MDX](https://mdxjs.com/)**. It allows you to use **[React and JSX](https://reactjs.org/docs/introducing-jsx.html)** in 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... +You can use both `.md` and `.mdx` file extensions, but **the `.mdx` extension** is recommended when using advanced features relying on React. ::: diff --git a/website/docs/installation.mdx b/website/docs/installation.mdx index 77d6baab05..22fd6be5f9 100644 --- a/website/docs/installation.mdx +++ b/website/docs/installation.mdx @@ -98,14 +98,15 @@ Assuming you chose the classic template and named your site `my-website`, you wi ```bash my-website ├── blog -│ ├── 2019-05-28-hola.md -│ ├── 2019-05-29-hello-world.md -│ └── 2020-05-30-welcome.md +│ ├── 2019-05-28-hola.mdx +│ ├── 2019-05-29-hello-world.mdx +│ └── 2020-05-30-welcome.mdx ├── docs -│ ├── doc1.md -│ ├── doc2.md -│ ├── doc3.md -│ └── mdx.md +│ ├── intro.mdx +│ ├── pages.mdx +│ ├── blog.mdx +│ ├── docs.mdx +│ └── markdown-features.mdx ├── src │ ├── css │ │ └── custom.css @@ -121,6 +122,14 @@ my-website └── yarn.lock ``` +:::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 Markdown documents. + +You can use both `.md` and `.mdx` file extensions, but **the `.mdx` extension** is recommended when using advanced features relying on React. + +::: + ### Project structure rundown {#project-structure-rundown} - `/blog/` - Contains the blog Markdown files. You can delete the directory if you've disabled the blog plugin, or you can change its name after setting the `path` option. More details can be found in the [blog guide](blog.mdx)