-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(v2): Reorganize/split the guides doc sections (#3975)
* docs reorg * refactor docs/markdown features section * fix broken links after docs refactor
- Loading branch information
Showing
20 changed files
with
1,347 additions
and
1,192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
id: create-doc | ||
title: Create a doc | ||
description: Create a Markdown Document | ||
slug: /create-doc | ||
--- | ||
|
||
Create a markdown file, `greeting.md`, and place it under the `docs` directory. | ||
|
||
```bash | ||
website # root directory of your site | ||
├── docs | ||
│ └── greeting.md | ||
├── src | ||
│ └── pages | ||
├── docusaurus.config.js | ||
├── ... | ||
``` | ||
|
||
At the top of the file, specify `id` and `title` in the front matter, so that Docusaurus will pick them up correctly when generating your site. | ||
|
||
```yml | ||
--- | ||
id: greeting | ||
title: Hello | ||
--- | ||
|
||
## Hello from Docusaurus | ||
|
||
Are you ready to create the documentation site for your open source project? | ||
|
||
### Headers | ||
|
||
will show up on the table of contents on the upper right | ||
|
||
So that your users will know what this page is all about without scrolling down or even without reading too much. | ||
|
||
### Only h2 and h3 will be in the toc | ||
|
||
The headers are well-spaced so that the hierarchy is clear. | ||
|
||
- lists will help you | ||
- present the key points | ||
- that you want your users to remember | ||
- and you may nest them | ||
- multiple times | ||
``` | ||
This will render in the browser as follows: | ||
import BrowserWindow from '@site/src/components/BrowserWindow'; | ||
<BrowserWindow url="http://localhost:3000"> | ||
<h2>Hello from Docusaurus</h2> | ||
Are you ready to create the documentation site for your open source project? | ||
<h3>Headers</h3> | ||
will show up on the table of contents on the upper right | ||
So that your users will know what this page is all about without scrolling down or even without reading too much. | ||
<h3>Only h2 and h3 will be in the toc</h3> | ||
The headers are well-spaced so that the hierarchy is clear. | ||
- lists will help you | ||
- present the key points | ||
- that you want your users to remember | ||
- and you may nest them | ||
- multiple times | ||
</BrowserWindow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
id: markdown-features | ||
title: Docs Markdown Features | ||
description: Docusaurus Markdown features that are specific to the docs plugin | ||
slug: /docs-markdown-features | ||
--- | ||
|
||
Docs can use any [Markdown feature](../markdown-features/markdown-features-intro.mdx), and have a few additional Docs-specific markdown features. | ||
|
||
## Markdown frontmatter | ||
|
||
Markdown docs have their own [Markdown frontmatter](../../api/plugins/plugin-content-docs.md#markdown-frontmatter) | ||
|
||
## Referencing other documents | ||
|
||
If you want to reference another document file, you could use the name of the document you want to reference. Docusaurus will convert the file path to be the final website path (and remove the `.md`). | ||
|
||
For example, if you are in `doc2.md` and you want to reference `doc1.md` and `folder/doc3.md`: | ||
|
||
```md | ||
I am referencing a [document](doc1.md). Reference to another [document in a folder](folder/doc3.md). | ||
|
||
[Relative document](../doc2.md) referencing works as well. | ||
``` | ||
|
||
One benefit of this approach is that the links to external files will still work if you are viewing the file on GitHub. | ||
|
||
Another benefit, for versioned docs, is that one versioned doc will link to another doc of the exact same version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
website/docs/guides/markdown-features/markdown-features-admonitions.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
id: admonitions | ||
title: Admonitions | ||
description: Handling admonitions/callouts in Docusaurus Markdown | ||
slug: /markdown-features/admonitions | ||
--- | ||
|
||
In addition to the basic Markdown syntax, we use [remark-admonitions](https://github.com/elviswolcott/remark-admonitions) alongside MDX to add support for admonitions. Admonitions are wrapped by a set of 3 colons. | ||
|
||
Example: | ||
|
||
:::note | ||
|
||
The content and title *can* include markdown. | ||
|
||
::: | ||
|
||
:::tip You can specify an optional title | ||
|
||
Heads up! Here's a pro-tip. | ||
|
||
::: | ||
|
||
:::info | ||
|
||
Useful information. | ||
|
||
::: | ||
|
||
:::caution | ||
|
||
Warning! You better pay attention! | ||
|
||
::: | ||
|
||
:::danger | ||
|
||
Danger danger, mayday! | ||
|
||
::: | ||
|
||
:::note | ||
|
||
The content and title _can_ include markdown. | ||
|
||
::: | ||
|
||
:::tip You can specify an optional title | ||
|
||
Heads up! Here's a pro-tip. | ||
|
||
::: | ||
|
||
:::info | ||
|
||
Useful information. | ||
|
||
::: | ||
|
||
:::caution | ||
|
||
Warning! You better pay attention! | ||
|
||
::: | ||
|
||
:::danger | ||
|
||
Danger danger, mayday! | ||
|
||
::: | ||
|
||
## Specifying title | ||
|
||
You may also specify an optional title | ||
|
||
:::note Your Title | ||
|
||
The content and title *can* include markdown. | ||
|
||
::: | ||
|
||
:::note Your Title | ||
|
||
The content and title _can_ include Markdown. | ||
|
||
::: |
Oops, something went wrong.