React文档 --> 使用特殊表格语法的GitHub Markdown文件

3
如果你查看一个React文档markdown文件(用于生成文档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"
---

所有我能找到的 GitHub/Markdown 资源都建议这样创建表格:

From https://guides.github.com/features/mastering-markdown/

Tables

You can create tables by assembling a list of words and dividing them with hyphens - (for the first row), and then separating each column with a pipe |:

First Header | Second Header
------------ | -------------
Content from cell 1 | Content from cell 2
Content in the first column | Content in the second column
我已经尽力搜索了,想知道这是否是一项记录在案的功能,以及该文档可能在哪里?
1个回答

6
那就是 YAML front matter,很多静态网站生成器都允许将其用作向文档添加元数据的手段。它实际上并不是 Markdown 的一部分 - GitHub 之所以提供良好的样式支持,是因为它被广泛使用。

正如 Waylan 所评论的那样,值得注意的是,在 Markdown 实际解析之前,前置内容通常会被静态网站生成器剥离 - 这就是为什么它不会出现在 React 文档页面中的原因。

* 包括 Jekyll,这是 React 文档GitHub Pages 使用的工具


可能有所帮助的是:使用前置元数据的工具通常会在将Markdown文本传递给Markdown解析器之前删除元数据。 - Waylan

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接