Ir para o conteúdo principal
Version: 2.x

Funcionalidades do Markdown

A documentação é uma das interfaces do seu produto com seus usuários. Um conjunto de documentos bem escrito e bem organizado ajuda os usuários a entender o seu produto rapidamente. Nosso objetivo alinhado aqui é ajudar seus usuários a encontrar e entender as informações de que precisam, o mais rapidamente possível.

Docusaurus 2 uses modern tooling to help you compose your interactive documentation with ease. Você pode incorporar componentes React, ou construir blocos de codificação ao vivo, onde seus usuários podem jogar com o código no local. Comece a compartilhar seus momentos de eureka com o código do qual seu público não pode fugir. É talvez a forma mais eficaz de atrair potenciais utilizadores.

info

Essa seção presume que você está usando os plugins oficiais de conteúdo do Docusaurus.

Standard features

Markdown is a syntax that enables you to write formatted content in a readable syntax.

We use MDX as the parsing engine, which can do much more than just parsing standard Markdown syntax, like rendering React components inside your documents as well.

### My Doc Section

Hello world message with some **bold** text, some _italic_ text, and a [link](/)

![img alt](/img/docusaurus.png)
http://localhost:3000

My Doc Section

Hello world message with some bold text, some italic text and a link

img alt

Markdown is declarative

Some may assume a 1-1 correlation between Markdown and HTML, e.g., ![Preview](/img/docusaurus.png) will always become <img src="/img/docusaurus.png" alt="Preview" />, as-is. However, that is not the case.

The Markdown syntax ![message](url) only declaratively tells Docusaurus that an image needs to be inserted here, but we may do other things like transforming a file path to URL path, so the generated markup may differ from the output of other Markdown renderers, or a naïve hand-transcription to the equivalent JSX/HTML code.

In general, you should only assume the semantics of the markup (``` fences become code blocks; > becomes quotes, etc.), but not the actual compiled output.

Front matter

Front matter is used to add metadata to your Markdown file. All content plugins have their own front matter schema, and use the front matter to enrich the default metadata inferred from the content or other configuration.

Front matter is provided at the very top of the file, enclosed by three dashes ---. The content is parsed as YAML.

---
title: My Doc Title
more_data:
- Can be provided
- as: objects
or: arrays
---

Quotes

Markdown quotes are beautifully styled:

> Easy to maintain open source documentation websites.
>
> — Docusaurus
http://localhost:3000

Easy to maintain open source documentation websites.

— Docusaurus

Details

Markdown can embed HTML elements, and details HTML elements are beautifully styled:

### Details element example

<details>
<summary>Toggle me!</summary>
<div>
<div>This is the detailed content</div>
<br/>
<details>
<summary>
Nested toggle! Some surprise inside...
</summary>
<div>😲😲😲😲😲</div>
</details>
</div>
</details>
http://localhost:3000

Details element example

Toggle me!
This is the detailed content

Nested toggle! Some surprise inside...

😲😲😲😲😲
note

In practice, those are not really HTML elements, but React JSX elements, which we'll cover next!