4

我正在尝试使用 DocUtils 和 reStructuredText 来注释 SQL 代码。当我在多行注释中包含标记时,我可以让它工作。然后我使用 --Some text:: 来介绍每个代码块。

我无法让内部超链接正常工作。我想写 -- .. Step1_: 但解析器忽略了这一点,因为前面的注释。使用多线样式也失败了。有没有办法让它工作?

这是一个例子:

/*
==========
this query
==========
:Author: Me

Outline
==========

- Create table 1

- Create table 2

- Output the result

*/

-- _Step1: build the table::

    create table table1

-- _Step2: use Step1_ to build table 2::

    create table table2
4

2 回答 2

6

我使用 Sphinx 来重构文本。内部超链接的语法是,例如,

.. 步骤1:

.. 代码块:: sql

   创建表table1     

这是稍后出现内部超链接的文本。笔记create table table1
的缩进。是一部分
..code -block::sql指令的,所以它必须缩进。
现在这里是内部链接。请参阅:ref:`step1` as
到如何创建表。
于 2011-04-24T17:30:02.463 回答
0

code-blockdocutils版本支持0.10或可能是0.9.

于 2014-04-05T14:13:57.023 回答