Markdown 参考指南

Fuchsia.dev 支持本指南中所述的 Markdown 元素。

块引用

Markdown 使用大于字符 (>) 将文本呈现为块引用(即引用的文本)。

Markdown

This is a Markdown paragraph.

> This is a blockquote with two paragraphs. The first line of a blockquote
> paragraph has to have a greater-than character (`>`), but for readability
> in the source file, add a greater-than character to every subsequent line
> of the paragraph like this example. Though this isn't a requirement as
> shown in the second blockquote paragraph below.
>
> This is a second blockquote paragraph that only has a greater-than
character (`>`) for the first line. Donec sit amet nisl. Aliquam semper
ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus
adipiscing. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec,
fringilla in, laoreet vitae, risus.

已渲染

这是一个 Markdown 段落。

这是包含两个段落的块引用。块引用段落的第一行必须包含大于字符 (>);但为了方便在源文件中阅读,请在段落的每个后续行中添加大于字符,如此示例所示。不过,这不是硬性要求,如下面的代码块引用段落中所示。

这是第二个块引用段落,其中第一行只有一个大于字符 (>)。Donec sit amet nisl。Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing。Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.

代码块

代码块用于提供程序化示例或标记源代码。代码块中的内容不会像普通 Markdown 段落一样解析,而是会按照所写时呈现。

您可以使用代码块来指定以哪种编程语言呈现代码,以便突出显示。

三个反引号 (```) 前后都需要空行。最终输出中不会呈现反引号。不过,代码块内的空白行会在最终输出中显示。

Markdown

Example 1: Uses Java syntax highlighting

```java
public class Hello {

  public static void main(String arg[]) {

    System.out.println("Hello.");
  }
}
```

Example 2: Prevents syntax highlighting

```none {:.devsite-disable-click-to-copy}
Some pseudo-code doesn't need syntax highlighting.
```

Example 3: Includes a replacement variable

```none {:.devsite-disable-click-to-copy}
Hello, my name is {{ '<var>' }}your-name{{ '</var>' }}.
```

生成的 HTML

<p>Example 1: Uses Java syntax highlighting</p>
<pre class="prettyprint lang-java"><code>public class Hello {<br/>public
static void main(String arg[]) {<br/>System.out.println("Hello.");<br/>}
<br/>}<br/></code></pre>
<p>Example 2: Prevents syntax highlighting</p>
<pre class="click-to-copy"><code><br/><p>Some pseudo-code doesn't need
syntax highlighting.</p><br/>
</code></pre>
<p>Example 3: Includes a replacement variable</p>
<pre class="no-prettyprint"><code><br/><p>Hello, my name is <var>your-name</var>.
</p><br/></code></pre>

已渲染

示例 1:使用 Java 语法突出显示

public class Hello {

  public static void main(String arg[]) {

    System.out.println("Hello.");
  }
}

示例 2:阻止语法突出显示

Some pseudo-code doesn't need syntax highlighting.

示例 3:添加替换变量

Hello, my name is your-name.

在代码块内使用可替换变量

如需在代码块中使用 <var> 标记,请使用 Jinja 表达式括号,如下所示:

{{ '<var>' }}PORT{{ '</var>' }}

上面的示例呈现以下内容:

PORT

注释

Fuchsia.dev 支持 Markdown 和 HTML 中的单行和多行注释。评论不会显示在已发布的页面上。如果您的文档包含 includecodeMathJax,这些注释将有助于提醒贡献者。

单行注释



多行注释

要在 fuchsia.dev 中使用多行注释,请执行以下操作:

使用 {# ... #} 换行。这适用于 HTML 和 Markdown:

{% verbatim %}
{# I wonder how drivers are doing? #}
{# I hear they are awesome! #}

自定义属性

借助 Fuchsia.dev,您可以在 Markdown 文件中设置自定义 HTML 属性(如 classidattribute='value')。

支持的 Markdown 元素

以下元素支持自定义属性:

  • 代码 span
  • 代码块
  • 标题
  • 链接
  • 列表
  • 段落
  • 表格和多行表格

格式

语法 说明
{”和“} 自定义属性的开头和结尾。
: 对于 fuchsia.dev 中的 Markdown 自定义属性,这是必需内容。
. 句点后的字词 (.) 设置元素的 class
# 哈希后的字词 (#) 设置元素的 id
attribute='value' 设置元素的属性名称和值对;使用空格分隔该键值对。

Markdown

This is a Markdown paragraph.
{:.customClass #custom_id attribute='value'}

生成的 HTML

<p class="customClass" id="custom_id" attribute="value">This is a Markdown paragraph.</p>

定义列表

如需在 Markdown 中创建定义列表,请将相应术语单独列出一行,然后在定义下方另起一行添加一个英文冒号 (:)。

Markdown

Apple
: A fruit
: A tech company

Orange
: A citrus fruit

    A definition can also contain other block or inline elements. This is a
    paragraph within the same definition as "A citrus fruit". Elements
    within must be indented four spaces to be recognized as part of the
    preceding definition.

: A color

生成的 HTML

<dl>
  <dt>Apple</dt>
  <dd>A fruit</dd>
  <dd>A tech company</dd>

  <dt>Orange</dt>
  <dd>
    <p>A citrus fruit</p>
    <p>
      A definition can also contain other block or inline elements. This is
      a paragraph within the same definition as "A citrus fruit". Elements
      within must be indented four spaces to be recognized as part of the
      preceding definition.
    </p>
  </dd>
  <dd>
    <p>A color</p>
  </dd>
</dl>

已渲染

Apple
水果
科技公司
橙色

一颗柑橘水果

定义还可以包含其他块或内嵌元素。此段落与“柑橘水果”定义相同。其中的元素必须缩进四个空格才会被识别为前一个定义的一部分。

一种颜色

强调效果和强烈感

Markdown 使用星号 (*) 和下划线 (_) 来强调强调效果并采用醒目的格式。

强调效果

使用一个星号 (*) 或下划线 (_) 中的文本可为特定文本设置斜体样式。

Markdown

*single asterisks*

_single underscores_

supercali*fragilistic*expialidocious

supercali_fragilistic_expialidocious                 // won't format

生成的 HTML

<em>single asterisks</em>

<em>single underscores</em>

supercali<em>fragilistic</em>expialidocious

supercali_fragilistic_expialidocious

已渲染

单个星号

单个下划线

超级脆弱性

supercali_fragilistic_expialidocious

使用双星号 (**) 或下划线 (__) 的文本可为特定文本指定粗体样式。

Markdown

**double asterisks**

__double underscores__

supercali**fragilistic**expialidocious

supercali__fragilistic__expialidocious

生成的 HTML

<strong>double asterisks</strong>

<strong>double underscores</strong>

supercali<strong>fragilistic</strong>expialidocious

supercali<strong>fragilistic</strong>expialidocious

已渲染

两个星号

双下划线

超级脆弱性

超级脆弱性

转义

某些字符是 Markdown 中的保留语法。如需使用特殊字符,请使用反斜杠转义 (\) 显示以下字面字符:

\   backslash
`   backtick
*   asterisk
_   underscore
{}  curly braces
[]  square brackets
()  parentheses
#   hash mark
+   plus sign
-   minus sign (hyphen)
.   dot
!   exclamation mark

脚注

脚注是一种很有用的工具,可帮助您在不中断页面浏览的情况下添加其他或补充内容。其语法与参考链接类似:

In the main text, include a label[^1] that starts with a caret.

[^1]: The footnote content goes here.

[^2]: Longer footnote content can be span multiple lines
    by indenting the continuation 4 spaces.

脚注标签可以是任意字符串,只要以脱字符号 ^ 开头即可。

标题

Markdown 支持在行开头使用 1-6 个哈希字符 (#) 的 atx 样式标题,这些字符对应于标题级别 1 到 6 级。

Markdown

# This is an H1

## This is an H2

###### This is an H6

已渲染

这是上半年

这是下半年

这是 H6

标头 ID

Fuchsia.dev 支持为每个标题使用自定义 HTML id 属性。如果要替换默认 id,请在 Markdown 标题的末尾添加自定义属性 {#user_defined_name}

Markdown

# Working with contacts {#working-with-contacts}
## Contact Entry
### Contacts are working

生成的 HTML

<h1 id="working-with-contacts">Working with contacts</h1>
<h2 id="contact-entry">Contact Entry</h2>
<h3 id="contacts-are-working">Contacts are working</h3>

目录

对于每个二级和三级标题,fuchsia.dev 会自动为页面生成目录 (TOC)。如需隐藏 TOC 中的标题,请在标题末尾添加自定义属性 {:.hide-from-toc}

Markdown

## Hidden in TOC {:.hide-from-toc}             // try to find it!

已渲染

隐藏在 TOC 中

水平规则

Markdown 通过在一行上放置三个或更多连字符、星号或下划线来支持水平规则标记 (<hr>)。

以下每一项都会生成一条水平规则:

* * *

***

*****

- - -

---------------------------------------

图像

Markdown 使用的图片语法与链接的语法类似,并支持两种样式:内嵌和引用。

每个图片都具有以下属性:

  • 起始感叹号:!
  • 一组方括号,包含 alt 属性文本。
  • 一对圆括号,包含图片的网址或路径,以及用双引号或单引号括起来的 title 属性(可选)。
  • 使用自定义属性语法 {: .my-custom-css-class} 的可选类集

内嵌语法

以下是有效的内嵌图片语法:

![Alt text](/docs/images/benchmarking/test_suite_example.png)

![Alt text](/docs/images/benchmarking/test_suite_example.png "Optional title")

![Alt text](/docs/images/benchmarking/test_suite_example.png "Optional title"){: .my-custom-css-class} 

引用语法

以下是引用式图片语法:

![Alt text][{{ '' }}ID{{ '' }}]

其中 {{ '' }}ID{{ '' }} 是已定义的映像引用的名称。图片引用使用与链接引用相同的语法进行定义:

{% verbatim %}[ID]: docs/images/benchmarking/test_suite_example.png  "Optional title attribute"

自定义语法

您可以使用以下语法指定 Markdown 图片的宽度:

![Alt text](/docs/images/benchmarking/test_suite_example.png){: width="123"} 

添加代码

includecode 标记包含来自其他文件的文本区域,尤其是源代码区域。该标记还可以在文本中生成可下载文件,而不是在文档中包含文本。

您可以使用此标记将部分源代码插入文档中,并将该源代码维护为可运行的文件。

gerrit_repo+path 参数是指托管在 Gerrit 或 Git 上的代码库和路径。repo 的格式为 instance or repositorypath 的格式为 path/to/file

{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="examples/fidl/fuchsia.examples/types.test.fidl" %}

包含文件的一部分

您可以通过三种方法指定要包含的文件区域:区域标记、正则表达式和缩进块。

区域标记

利用地区标记,您可以向源文件添加几行代码,以指明相应区域的第一行和最后一行以及标记名称。

{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="examples/fidl/fuchsia.examples/types.test.fidl" region_tag="consts" %}

渲染时间:

const BOARD_SIZE uint8 = 9;
const NAME string = "Tic-Tac-Toe";

正则表达式

您还可以使用正则表达式使用 regexp 参数来定义要提取的区域。例如:

{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="examples/fidl/fuchsia.examples/types.test.fidl" regexp="WRITE = 0b010;" %}

渲染时间:

WRITE = 0b010;

该模式使用 Python 正则表达式语法。如需了解详情,请参阅官方 Python 文档

缩进块

您可以在不定义区域标记的情况下添加函数或类定义中的代码。 使用 indented_block 参数:

{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="examples/fidl/fuchsia.examples/types.test.fidl" indented_block="type User" %}

渲染时间:

type User = table {
    1: reserved;
    2: age uint8;
    3: name string:MAX_STRING_LENGTH;
};

该模式使用 Python 正则表达式语法。如需了解详情,请参阅官方 Python 文档

参数

以下是 includecode 的可选参数:

Markdown

参数
highlight 可选
您可以使用 highlight 参数来关注代码的特定部分。 使用逗号分隔值以指示要突出显示的行。行号是相对于您选择的区域而言的,而非整个文件。

示例
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="examples/fidl/fuchsia.examples/types.test.fidl" region_tag="bits" highlight="2,3,4" %}
adjust_indentation 可选
默认情况下,includecode 会返回源代码的指定部分,包括空格。您可以使用 adjust_indentation 选项调整代码的缩进。

adjust_indentation 采用两个可能的值:
  • number - 一个整数。这表示每行将取消缩进的空格数。 例如,值为 4 会将行缩进 4 个空格,而值为 -2 会将行缩进 2 个空格。
  • 'auto' - 字符串 auto。发布工具将按在区域中找到的最少前导空格数取消缩进所选代码。也就是说,它会移除代码段中所有行通用的前导空格。
示例
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="examples/fidl/fuchsia.examples/types.test.fidl" region_tag="bits" adjust_indentation="-2" %}
html_escape 可选
默认情况下,includecode 会 HTML 转义所有代码。您可以将 html_escape 设置为 False 以反转义 HTML。

示例
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="examples/fidl/fuchsia.examples/echo.test.fidl" region_tag="launcher" html_escape="False" %}
exclude_regexp 可选
您可以根据正则表达式移除某些行。这对于移除评论或其他不相关的内容非常有用。不能使用多行正则表达式。

示例
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="examples/fidl/fuchsia.examples/types.test.fidl" region_tag="bits" exclude_regexp="READ" %}

已渲染

参数
highlight highlight="2,3,4"之前:
        bits FileMode : uint16 {
          READ = 0b001;
          WRITE = 0b010;
          EXECUTE = 0b100;
        };
highlight="2,3,4"之后:
        bits FileMode : uint16 {
          READ = 0b001;
          WRITE = 0b010;
          EXECUTE = 0b100;
        };
adjust_indentation adjust_indentation="-2"之前:
        bits FileMode : uint16 {
          READ = 0b001;
          WRITE = 0b010;
          EXECUTE = 0b100;
        };
adjust_indentation="-2"之后:
            bits FileMode : uint16 {
              READ = 0b001;
              WRITE = 0b010;
              EXECUTE = 0b100;
            };
html_escape html_escape="False"之前:
MAX_STRING_LENGTH echo_prefix, request<Echo> request);
html_escape="True"之后:
MAX_STRING_LENGTH echo_prefix, request request);
exclude_regexp exclude_regexp="READ"之前:
      bits FileMode : uint16 {
        READ = 0b001;
        WRITE = 0b010;
        EXECUTE = 0b100;
      };
exclude_regexp="READ"之后:
      bits FileMode : uint16 {
        WRITE = 0b010;
        EXECUTE = 0b100;
      };

包含 Markdown Fragment

您可以使用封装所需文件路径的 << >> 指令将 Markdown 文件添加到当前的 Markdown 文件中,以便进行正常处理。该路径必须相对于当前 .md 源文件,不应使用绝对路径。<< >> 指令是一个块指令,因此必须单独显示在一行上。

例如,如果当前文件 en/time-travel/example.md 想要包含文件 en/time-travel/_samples/_sample.md,则会指定:

<<_samples/_sample.md>>

内嵌代码

您可以使用反引号 (`) 将文本括起来,从而在 Markdown 段落中指明代码。

Markdown

Use the `printf()` function. Code for the `printf()` function is located in the `system\ ` directory.

This sentence has inline `  {code}    ` with a lot of spaces but none are rendered.

生成的 HTML

<p>Use the <code>printf()</code> function. Code for the <code>printf()</code>
function is located in the <code>system\</code> directory.</p>
<p>This sentence has inline <code>{code}</code>with a lot of spaces but none
are rendered.</p>

已渲染

使用 printf() 函数。printf() 函数的代码位于 system\ 目录中。

此语句包含大量空格的内嵌 {code},但没有渲染任何内容。

内嵌 HTML

Markdown 语法并不能提供 HTML 的全功能,但支持内嵌 HTML。您可以将文本用 HTML 元素标记换行,例如:

Markdown

This sentence is in Markdown with a <b>bold inline HTML tag</b>.

已渲染

此语句在 Markdown 中,其中包含粗体内嵌 HTML 标记

Fuchsia.dev 支持三种样式的链接:内嵌、引用和外部。在所有样式下,链接文字都由 [](方括号)分隔。

要创建内嵌链接,请在链接文本的右方括号后面紧跟一对圆括号。在圆括号内添加链接所指向的网址,以及用引号括起来的链接标题(可选)。例如:

Markdown

This is [an example](https://fuchsia.dev/ "Title") inline link.

[This link](https://fuchsia.dev/) has no title attribute.

生成的 HTML

<p>This is <a href="https://fuchsia.dev/" title="Title">
an example</a> inline link.</p>

<p><a href="fuchsia.dev">This link</a> has no
title attribute.</p>

已渲染

这是 示例内嵌链接。

此链接没有商品名属性。

如果您引用的是本地资源(如源代码树中的文件),则可以使用相对路径。如需查看示例,请参阅文档自述文件

引用式链接使用第二组方括号,您可以在其中提供用于标识链接的标签:

This is [an example][id] reference-style link.

您可以选择使用空格来分隔两组括号:

This is [an example] [id] reference-style link.

然后,在文档底部,在文档底部以一行定义链接:

[id]: https://{{example_url}}/  "Optional Title Here"

您可以在语法中添加 {: .external},提醒读者链接将指向外部网站。例如:

See the [official documentation](https://my_external_website){: .external} for details.

指向 Fuchsia 源代码或 Fuchsia 更改的链接不是外部链接。

无论您通过何种方式在内容中创建 Markdown 链接,都可以从 Fuchsia.dev 链接到不同类型的内容:

  • 由 Fuchsia 源代码树的 //docs 目录中的贡献者创建的内容。

    示例:这是指向 //docs/get-started/learn-fuchsia.md 的链接:

    [Learn Fuchsia](/docs/get-started/learn-fuchsia.md)
    
  • Fuchsia 源代码树中不存在的自动生成的内容,例如 fuchsia.dev/reference

    示例:这是 fuchsia.bluetooth 生成的 API 参考文档的链接:

    [`fuchsia.bluetooth`](https://fuchsia.dev/reference/fidl/fuchsia.bluetooth)
    

    Fuchsia 还有未生成的参考内容,这些内容位于 //docs/reference/ 目录中。可以使用 Fuchsia 源代码树内容语法链接此类内容。

  • 指向网址的链接。这些类型的链接必须标记为外部

    示例:这是指向 google.com 的链接:

    [`google.com`](https://google.com){: .external} 
    

列表

使用 Markdown 语法,您可以轻松创建项目符号或编号列表。这些列表通常称为无序(即带项目符号)或有序(带编号)的列表,因为它们是指生成的 (<ul>) 和 (<ol>) HTML 标记。

无序列表

无序列表可以使用星号 (*)、加号 (+) 或短划线 (-) 作为列表标记。无论您使用哪种标记,列表的呈现效果都是一样的。

Markdown

This is a Markdown paragraph:
                                             // required blank line
* Red
* Green
* Blue

This is another Markdown paragraph:
                                            // required blank line
+ Red
+ Green
+ Blue

This is yet another Markdown paragraph:
                                            // required blank line
- Red
- Green
- Blue

生成的 HTML

<p>This is a Markdown paragraph:</p>
<ul>
  <li>Red</li>
  <li>Green</li>
  <li>Blue</li>
</ul>
<p>This is another Markdown paragraph:</p>
<ul>
  <li>Red</li>
  <li>Green</li>
  <li>Blue</li>
</ul>
<p>This is yet another Markdown paragraph:</p>
<ul>
  <li>Red</li>
  <li>Green</li>
  <li>Blue</li>
</ul>

已渲染

这是一个 Markdown 段落:

  • 红色
  • 绿色
  • 蓝色

以下是另一个 Markdown 段落:

  • 红色
  • 绿色
  • 蓝色

以下是另一个 Markdown 段落:

  • 红色
  • 绿色
  • 蓝色

多级无序列表

对于多级无序列表中的列表标记,您可以使用星号 (*)、加号 (+) 或短划线 (-)。二级标记前面必须至少有四个空格,并且在每个级别保持一致。请参见下面的示例:

Markdown

This is a Markdown paragraph:
                              // required blank line before parent list
 * Bird
     * Celtics
     * Retired
       * Larry                // extra space; not consistent w/ "Celtics"
 * Magic
     * Lakers

生成的 HTML

<p>This is a Markdown paragraph:</p>
<ul>
  <li>Bird
    <ul>
      <li>Celtics</li>
      <li>Retired</li>
      <ul>
        <li>Larry</li>
      </ul>
    </ul>
  </li>
  <li>Magic
    <ul>
      <li>Lakers</li>
    </ul>
  </li>
</ul>

已渲染

这是一个 Markdown 段落:

    • 凯尔特人
    • 已停用
      • Larry
  • 魔法
    • 湖人

有序列表

有序列表在列表项前面使用数字和句点。您可以在有序列表中定义自己的序数,也可以使用 1. 实现自动编号。请参见下面的示例:

Markdown

This is a Markdown paragraph:
                                   // required blank line
1. Bird                            // recommended numbering
1. McHale
1. Parish

This is another Markdown paragraph:
                                   // required blank line
1. Bird                            // sequential numbering is allowed,
2. McHale                          // but not recommended
3. Parish

This is yet another Markdown paragraph:
                                   // required blank line
3. Bird                            // non-sequential numbering is allowed,
1. McHale                          // but not recommended
8. Parish

生成的 HTML

<p>This is a Markdown paragraph:</p>
<ol>
  <li>Bird</li>
  <li>McHale</li>
  <li>Parish</li>
</ol>
<p>This is another Markdown paragraph:</p>
<ol>
  <li>Bird</li>
  <li>McHale</li>
  <li>Parish</li>
</ol>
<p>This is yet another Markdown paragraph:</p>
<ol>
  <li>Bird</li>
  <li>McHale</li>
  <li>Parish</li>
</ol>

已渲染

这是一个 Markdown 段落:

  1. McHale

以下是另一个 Markdown 段落:

  1. McHale

以下是另一个 Markdown 段落:

  1. McHale

多级有序列表

您可以创建多级有序列表;第二级标记前面必须至少有四个空格。

Markdown

 1. Bird
     1. Lakers
 1. McHale
     1. Celtics

生成的 HTML

<ol>
  <li>Bird
    <ol>
      <li>Lakers</li>
    </ol>
  </li>
  <li>McHale
    <ol>
      <li>Celtics</li>
    </ol>
  </li>
</ol>

已渲染

    1. 湖人
  1. McHale
    1. 凯尔特人

MathJax

借助 <devsite-mathjax> 自定义元素,您可以使用 MathJax 2.7 在 fuchsia.dev 内容中显示数学符号。MathJax 利用 LaTeX 语法来创建数学概念。如需了解详情,请参阅 LaTeX 语法指南

用法

要在文档中使用 MathJax,必须在文档中一次性添加自定义元素:

  {# To see the fully rendered MathJax equations on this page,
  see the published page at https://fuchsia.dev/<PATH_TO_YOUR_DOCUMENT>#}
  <devsite-mathjax config="TeX-AMS-MML_SVG"></devsite-mathjax>

添加自定义元素后,您可以在 $$ block or $ inline.

Standalone block

Markdown

<!-- <devsite-mathjax config="TeX-AMS-MML_SVG"></devsite-mathjax> -->

<div>
  $$
  R_{\mu\nu}-\frac{1}{2}Rg_{\mu\nu}+\Lambda{g_{\mu\nu}} = \frac{8\pi{G}}{c^4}{T_{\mu\nu}}
 $$
</div>

Rendered

$$ R_{\mu\nu}-\frac{1}{2}Rg_{\mu\nu}+\Lambda{g_{\mu\nu}} = \frac{8\pi{G}}{c^4}{T_{\mu\nu}} $$ 中编写数学概念

Inline

Markdown

<!--Included only one time previously-->
<devsite-mathjax config="TeX-AMS-MML_SVG"></devsite-mathjax>

The area of a circle can be computed using the equation $ A = \pi{r^2} $,
where $ r $ is the radius of the circle, and $ \pi $ is the mathematical
constant that is approximately equal to 3.14159.

Rendered

The area of a circle can be computed using the equation $ A = \pi{r^2} $, where $ r $ is the radius of the circle, and $ \pi $ is the mathematical constant that is approximately equal to 3.14159.

Paragraphs

A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line -- a line containing nothing but spaces or tabs is considered blank.) You do not need to indent normal paragraphs with spaces or tabs.

Tables

Markdown makes it easy to format tables with pipes (|) and hyphens (-). Deliminate text with pipes to create columns; a header row is defined when the following row has at least three hyphens for each column header.

Markdown

Lesson                     | Description
------------------------   | ---------------------------------------
What is Fuchsia?           | An open source effort to create a production-grade operating system
What is FIDL?              | Fuchsia Interface Definition Language
Getting Started            | Download the Fuchsia source code

Generated HTML

<table>
  <thead>
    <tr>
      <th>Lesson</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>What is Fuchsia?</td>
      <td>An open source effort to create a production-grade operating system</td>
    </tr>
    <tr>
      <td>What is FIDL?</td>
      <td>Fuchsia Interface Definition Language</td>
    </tr>
    <tr>
      <td>Getting Started</td>
      <td>Download the Fuchsia source code</td>
    </tr>
  </tbody>
</table>

Rendered

Lesson Description
What is Fuchsia? An open source effort to create a production-grade operating system
What is FIDL? Fuchsia Interface Definition Language
Getting Started Download the Fuchsia source code

Formatting text in a table

You can use Markdown syntax to format text within a table (that is, *emphasis*, **strong**, `code`). To align text within a column, add a colon : in the dash --- row to indicate direction (that is, left, center, right) as in the example below:

Markdown

Left-aligned     | Center-aligned | Right-aligned
:---             |     :---:      |          ---:
info             | info           | info
more info        | more info      | more info
even *more* info | some `code`    | **not** code

Rendered

Left-aligned Center-aligned Right-aligned
info info info
more info more info more info
even more info some code not code