【问题标题】:First line indentation in SphinxSphinx 中的第一行缩进
【发布时间】:2021-08-10 17:05:31
【问题描述】:

我没有设法强制 sphinx 将第一行缩进应用于具有 ReadTheDoc 主题的段落。我试过了

texinfo_elements = {'paragraphindent': 2}

但它似乎不起作用。还有其他事情要做吗?

【问题讨论】:

  • RTD 主题仅用于 HTML 输出。 texinfo 是一个不同于 html 的构建器。
  • 我想在 html 输出中对段落进行第一行缩进。有可能吗?

标签: python-sphinx


【解决方案1】:

您可以通过text-indent 使用自定义样式。

您可以将此样式添加到custom.css 文件中,并将其作为配置选项html_css_files 包含在您的conf.py 中。

custom.css

p {
  text-indent: 1em;
}

conf.py

​​>
html_css_files = ['custom.css']

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多