极简的{ascidoc/pod/phpdoc}-类似于html/markdown/whatever'格式的纯文本,具有非常简单的解释器和非常简单的语法
zerodoc的Python项目详细描述
1.1段落和行
ZeroDoc文件是按段落组织的简单文本文件。一 段落是一组与其他段落分开的文本行 空白行。可以逐字复制列表和源代码 定义。基于 参考系统。
对于常规(非代码)行,限制为72个字符 或图表)文本。如果你需要把更多的东西排成一行 (例如,一个长url),将其分成两部分,并放一个反斜杠() 结尾没有空格。
示例:
This is a very long url that needs to be splitted in three: http://www.reallyreallyreallylonguniformresourcelocatorredir\ ection.com/redirectionator.php?theredirectioncode=d72a565ab8\ 7dedf7b5fa84b3ec4b9f11
渲染到:
这是一个很长的url,需要分成三部分: http://www.reallyrealllylongiformresourcelocatorredirection.com/redirectionator.php?方向码=D72A565AB87DEDF7B5FA84B3EC4B9F11
1.2列表
列表被定义为以破折号为前缀的段落,可以是 嵌套的例
- The first element in a list - A nested element into the first consisting of two lines that are joined on output - Another nested element - The third element in a list
渲染到:
-
列表中的第一个元素
- 第一个元素中的嵌套元素,由在输出时连接的两行组成
- 另一个嵌套元素
- 列表中的第三个元素
反斜杠连接也出现在列表元素中:
- The first element in a list. as it have two lines with no backslash, an space is inserted between 'lines' and 'with' - To join the two lines without adding a space a back\ slash is used. Note that the two spaces formatting the listline are removed
渲染到:
- 列表中的第一个元素。因为它有两行没有反斜杠,所以在"行"和"带"之间插入一个空格
- 要在不添加空格的情况下连接这两行,请使用反斜杠。请注意,格式化列表行的两个空格在反斜杠之后被删除
注意:没有编号列表。在ZeroDoc的"系统论"中, 不能从原始文本中省略数字,也不能"计算" 因为这样会使文本的可读性比处理文本的可读性差 输出:
1.3格式化属性
从其他常用格式继承的文本的一些属性 支持电子邮件约定:
- This is an *emphasis* - This is an _underline_ (cursive on certain displays or formats, as in manual pages) - This is a 'cursive'
渲染到:
- 这是一个强调
- 这是一个下划线(在某些显示器或格式上是草书,如在手册页中)
- 这是"草书"
1.4链接
链接可以直接与目的地一起包含在文本中, 或先在文本中引用,然后在另一行中"解析"。
链接源:
This `link`:http://www.google.com will redirect to google
将呈现为:
此链接将重定向到google
引用的链接在链接列表中被"解析"。此链接列表 将直接从输出中移除。如果列表包含在 仅部分,该部分也从输出。见 本文档源代码末尾的"引用"部分 举个例子。"autocontained"示例可以是:
This line contains two referenced links: `firstlink` and `secondlink` - `firstlink`:http://www.google.com - `secondlink`:http://www.google.com
wich渲染到:
这一行包含两个引用链接: firstlink 和 secondlink
1.5源代码
源代码是将逐字包含在输出中的文本。在 源代码,换行符是有意义的,行长度没有限制 征税。例如:
#include <stdio.h> int main() { // print hello world 100 times for (int i = 0; i < 100; i++) { printf("Hello, world!\n"); } }
源代码在 第一行和其余的一个或多个空格。没有标签可以 使用,因此在粘贴之前,转换选项卡只能是源代码 或者使用expand(1)这样的工具来帮你。空行也是 包括逐字记录,直到下一个"常规"的 段落(包含文本并从第一列开始的段落)
为了演示源代码,我将粘贴源代码(yo 上例的dawg),以及常规段落行 排序:
source code, newlines are meaningful and no limits on line-length are imposed. An example: #include <stdio.h> int main() { // print hello world 100 times for (int i = 0; i < 100; i++) { printf("Hello, world!\n"); } } Source code is identified by one space before the content of the first line and one or more spaces in the rest. No tabs can When pygmentize is used, the default language for syntax highlighting can be specified in options.
1.6图表和图像
图表可以直接包含在输出中,就像 源代码,或者可选地转换为图像(当 可能,例如在手册页中 包括图像)。使用ditaa、aafigure和 ascii2svg或tikz取决于解析到渲染器的选项。 有关 有关此格式的帮助。
通过在 第一行。下一个"常规"段落之前的任何内容 被视为图表的一部分。
源代码段落和关系图不能相邻;它们需要 "常规"文本段落(从第一列开始),介于 他们。这是有意义的,因为没有图可以遵循源代码或 维切弗萨至少没有介绍读者是什么 看,
1.6.1 asciitosvg ascii艺术图
ascii艺术图的默认值是ascitosvg。顾名思义, 它将文本转换为svg非常方便。它是用php编写的。 示例图:(ascitosvg)
1.6.2 aa图ascii艺术图
将ascii艺术图转换为图形的另一种格式是aafigure。它 是用python编写的,并且有非常方便的习惯用法,例如 序列图:
1.6.3 DITAA ASCII艺术图
另一种常见的ascii艺术图格式是ditaa。它不 支持SVG输出。
This is the source code of the following paragraph (diagram taken from the `ditaa website`: Example diagram: (ditaa) +--------+ +-------+ +-------+ | | --+ ditaa +--> | | | Text | +-------+ |diagram| |Document| |!magic!| | | | {d}| | | | | +---+----+ +-------+ +-------+ : ^ | Lots of work | +-------------------------+
这是下一段的源代码 (图取自DITAA网站
注意,第一个+之前有两个空格-
1.6.4 tikz图
tikz图(来自tikz示例)
tikz块的乳胶源代码:
This is a very long url that needs to be splitted in three: http://www.reallyreallyreallylonguniformresourcelocatorredir\ ection.com/redirectionator.php?theredirectioncode=d72a565ab8\ 7dedf7b5fa84b3ec4b9f110
1.6.6图表标记和自动检测
与源代码一样,tikz和 gnuplot图。此检测可以通过在 图表的第一行,在括号之间。
1.7定义列表
定义列表是术语和相应定义的列表。 它通常在 相对于标题缩进的定义。它对 记录功能和命令行参数。
下面是一个示例:
This is a very long url that needs to be splitted in three: http://www.reallyreallyreallylonguniformresourcelocatorredir\ ection.com/redirectionator.php?theredirectioncode=d72a565ab8\ 7dedf7b5fa84b3ec4b9f111
呈现为:
< dl >1.8默认零文档结构
1.8.1标题
ZeroDoc文档的标题包含标题,可选 摘要和目录。目录需要 手动更新(这与其他众所周知的文本不同 格式,但允许ZeroDoc有自由格式的标题(no-nor ~~~不需要任何其他形式的标记:
This is a very long url that needs to be splitted in three: http://www.reallyreallyreallylonguniformresourcelocatorredir\ ection.com/redirectionator.php?theredirectioncode=d72a565ab8\ 7dedf7b5fa84b3ec4b9f112
1.8.1.1标题
标题可以产生几行(一整段)将 输出时连接在一起
目录的前缀可以是"目录"行 这将被自动识别为目录标题。如果那条线 不存在,它也将在转换后的输出上显示。
1.8.1.2摘要
摘要是出现在表格前面的一组段落 内容的。
1.8.1.3目录
目录是不同 部分,例如
This is a very long url that needs to be splitted in three: http://www.reallyreallyreallylonguniformresourcelocatorredir\ ection.com/redirectionator.php?theredirectioncode=d72a565ab8\ 7dedf7b5fa84b3ec4b9f113
将定义文档的目录(如果在 标题(在摘要之后)。如果找不到此处列出的标题 在文档中,会产生一个错误。
1.8.2车身
正文由几段组成。段落被分割 按标题行分成若干部分。标题行应该 出现在目录中,并且应该具有与目录相同的内容。 为了清楚起见,它们可以是大写的。作为转化者 文档通常有更好的方式来强调标题, 将使用TOC中使用的小写格式,而不管 使用大写字母。例如,本文档的下一节 以
This is a very long url that needs to be splitted in three: http://www.reallyreallyreallylonguniformresourcelocatorredir\ ection.com/redirectionator.php?theredirectioncode=d72a565ab8\ 7dedf7b5fa84b3ec4b9f114
在目录中,相关行显示为:
This is a very long url that needs to be splitted in three: http://www.reallyreallyreallylonguniformresourcelocatorredir\ ection.com/redirectionator.php?theredirectioncode=d72a565ab8\ 7dedf7b5fa84b3ec4b9f115
正如您在下一节开头看到的,标题出现了 小写(如上面的目录所示)