feat(v2): add 'custom_edit_url' and 'hide_title' markdown header feature (#1838)

* feat(v2): add 'custom_edit_url' and 'hide_title' markdown header feature

* nits
This commit is contained in:
Endi 2019-10-14 17:25:05 +07:00 committed by GitHub
parent 1dddb1f5ea
commit 94b0451fa4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 62 additions and 4 deletions

View file

@ -92,6 +92,28 @@ The headers are well-spaced so that the hierarchy is clear.
</BrowserWindow>
### Markdown Headers
Documents use the following markdown header fields that are enclosed by a line `---` on either side:
- `id`: A unique document id. If this field is not present, the document's `id` will default to its file name (without the extension).
- `title`: The title of your document. If this field is not present, the document's `title` will default to its `id`.
- `hide_title`: Whether to hide the title at the top of the doc. By default it is `false`.
- `sidebar_label`: The text shown in the document sidebar and in the next/previous button for this document. If this field is not present, the document's `sidebar_label` will default to its `title`.
- `custom_edit_url`: The URL for editing this document. If this field is not present, the document's edit URL will fall back to `editUrl` from options fields passed to `docusaurus-plugin-content-docs`.
Example:
```md
---
id: doc-markdown
title: Markdown Features
sidebar_label: Markdown :)
custom_edit_url: https://github.com/facebook/docusaurus/edit/master/docs/api-doc-markdown.md
---
```
### Embedding React components
Docusaurus has built-in support for [MDX](https://mdxjs.com), which allows you to write JSX within your Markdown files and render them as React components.