mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 08:49:51 +02:00
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:
parent
1dddb1f5ea
commit
94b0451fa4
7 changed files with 62 additions and 4 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue