React docs - >使用特殊表语法的GitHub markdown文件

Mic*_*wis 3 markdown github github-flavored-markdown reactjs

如果您查看React docs markdown文件(用于生成docs html页面),您将在最顶部看到一个值(在.md,而不是.html).如果查看用于创建表的实际markdown语法,您将看到非标准表语法:

---
id: hello-world
title: Hello World
permalink: docs/hello-world.html
prev: installation.html
next: introducing-jsx.html
redirect_from:
  - "docs/index.html"
  - "docs/getting-started.html"
  - "docs/getting-started-ko-KR.html"
  - "docs/getting-started-zh-CN.html"
---
Run Code Online (Sandbox Code Playgroud)

我能找到的所有GitHub/markdown资源都表明这些表是这样创建的:

来自https://guides.github.com/features/mastering-markdown/

您可以通过组合单词列表​​并用连字符-(对于第一行)分隔它们,然后用管道分隔每个列来创建表格|:

First Header | Second Header
------------ | -------------
Content from cell 1 | Content from cell 2
Content in the first column | Content in the second column
Run Code Online (Sandbox Code Playgroud)

我已经用尽了谷歌的谷歌技能,并想知道是否有人知道这是否是一个记录的功能,以及该文档可能在哪里?

Joe*_*lay 6

这是YAML前端问题,许多静态站点生成器*允许将其作为向文档添加元数据的手段.它实际上并不是Markdown本身的一部分--GitHub只为它提供了漂亮的样式,因为它是如此常用.

正如Waylan评论的那样,值得注意的是,在Markdown实际被解析之前,静态网站生成器通常会剥离前端问题 - 因此它没有出现在React文档页面中.

*包括Jekyll,这是React的文档GitHub页面使用的