【问题标题】:reStructuredText lists with custom enumerator带有自定义枚举器的 reStructuredText 列表
【发布时间】:2014-08-28 09:51:09
【问题描述】:

考虑http://en.cppreference.com/w/cpp/container/vector/vector 上“复杂性”列表中的项目“2-3)”。我怎样才能在 reStructuredText/Sphinx 中实现同样的目标?

我最接近的是写作

| 1) ...
| 2-3) ...
| 4) ...

但这会破坏列表格式(枚举数和分割线没有正确缩进)。另一种选择是使用表格,但我不想要表格格式。

【问题讨论】:

    标签: python-sphinx restructuredtext


    【解决方案1】:

    找到以下解决方法。将您的列表定义为

    .. rst-class:: custom-enumeration
    
    ==== ===
     \1) ...
    2-3) ...
     \4) ...
    ==== ===
    

    并将以下 sn-p 添加到您的 CSS 文件中。

    /* Define enumerations with custom enumerators */
    table.custom-enumeration td {
        border: 0px none;
    }
    table.custom-enumeration td:first-child {
        padding-right: 5px;
        text-align: right;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-07
      • 1970-01-01
      相关资源
      最近更新 更多