【问题标题】:Showing indentations in Sphinx output在 Sphinx 输出中显示缩进
【发布时间】:2017-05-26 03:51:22
【问题描述】:

我正在尝试构建一个 restructuredText 文件,以便 sphinx 在 html 中呈现层次结构。如何构建 RST 格式以实现如下打印输出:

这个

   Is

      An 

   Example

       output

【问题讨论】:

    标签: python indentation python-sphinx restructuredtext


    【解决方案1】:

    .. code-block:: text 手动缩进文本是一种选择。如果是文件层次结构,我喜欢使用tree 来创建 ASCII 艺术图。

    嵌套列表是另一个。注意rules for nesting

    可以使用嵌套列表,但请注意,它们必须用空行与父列表项分开:

    * This
    
      * Is
    
        * An 
    
      * Example
    
        * output
    

    如果您不关心项目符号,可以使用 CSS 将其删除。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-01
      • 2020-12-27
      • 2018-10-02
      相关资源
      最近更新 更多