【问题标题】:reStructuredText for SQL?SQL的reStructuredText?
【发布时间】:2011-03-04 23:23:33
【问题描述】:

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

我无法使用内部超链接。我想写 - .. 步骤1_: 但解析器忽略了这一点,因为领先的评论。使用多线样式也失败了。有没有办法让它工作?

这是一个例子:

/*
==========
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

【问题讨论】:

    标签: sql restructuredtext docutils


    【解决方案1】:

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

    .. 步骤1: .. 代码块:: sql 创建表 table1 这是稍后出现内部超链接的文本。笔记 create table table1 的缩进。是一部分 ..code-block::sql 指令,所以它必须缩进。 现在这里是内部链接。请参阅:ref:`step1` as 到如何创建表。

    【讨论】:

      【解决方案2】:

      docutils 支持code-block 版本0.10 或可能是0.9

      【讨论】:

        猜你喜欢
        • 2023-03-31
        • 1970-01-01
        • 2015-08-07
        • 1970-01-01
        • 1970-01-01
        • 2011-01-22
        • 2016-12-21
        • 2011-02-14
        • 1970-01-01
        相关资源
        最近更新 更多