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,这些注释可用于提醒贡献者。

单行注释

{# This is a single line comment #}

多行注释

如需在 fuchsia.dev 上使用多行注释,请执行以下操作:

使用 {# ... #} 封装每一行。这适用于 HTML 和 Markdown:

{# 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

已呈现

单星号

单下划线

supercalifragilisticexpialidocious

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

已呈现

双星号

双下划线

supercalifragilisticexpialidocious

supercalifragilisticexpialidocious

转义

某些字符是 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 支持 atx 式标题,该标题在行开头使用一到六个井号字符 (#),分别表示一级到六级标题。

Markdown

# This is an H1

## This is an H2

###### This is an H6

已呈现

这是 1 级标题

这是 2 级标题

这是 6 级标题

标头 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)。如需从目录中隐藏标题,请在标题末尾添加自定义属性 {:.hide-from-toc}

Markdown

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

已呈现

隐藏在目录中

水平分隔线

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 是所指定图片引用的名称。 图片引用使用与链接引用相同的语法定义。

[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: age uint8;
    2: 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 片段

您可以使用 << >> 指令(将所需的文件路径括起来)将 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 灵活,但 Markdown 支持内嵌 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>

已呈现

这是一个 示例内嵌链接。

此链接没有 title 属性。

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

引用链接会使用第二对方括号,其中是您选择用来标识链接的标签:

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

您也可以选择使用一个空格分隔这两对圆括号:

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

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

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

通过隐式参考链接,您可以省略链接的名称。 这种情况下,链接文本本身就是其名称。如需使用隐式参考链接,请使用一组方括号。例如,如需将“Fuchsia”一词链接到 fuchsia.dev 网站,请执行以下操作:

[Fuchsia]

然后定义链接:


链接名称可以包含空格,因此这也适用于链接文本包含多个字词的情况:

Visit the [Fuchsia developer site] for more information.

然后定义链接:


您可以在语法中添加 {: .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.dev/reference,该内容在 Fuchsia 源代码树中不存在。

    示例:以下是指向生成的 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
  2. 教区

这是另一个 Markdown 段落:

  1. McHale
  2. 教区

这是另一个 Markdown 段落:

  1. McHale
  2. 教区

多级有序列表

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

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. 小孟
    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