【问题标题】:Word wrap in Sphinx autosummary-generated tableSphinx 自动摘要生成表中的自动换行
【发布时间】:2021-11-10 17:38:05
【问题描述】:

我使用 Sphinx 为我的项目生成文档,扩展名为 autosummary。它会生成一个包含我的模块名称及其摘要的表格。

这是结果的图像:

但是,行太长了,我们必须使用滑块来阅读整个描述。

我想包装描述文本,以摆脱滑块。我到处找了,一无所获。

我尝试将| xxxx<br /> xxxx 放在我的描述中,但没有成功。

提前谢谢你!

【问题讨论】:

  • 用您自己的样式覆盖桌子上的 CSS。特别是.wy-table-responsive table td, .wy-table-responsive table th { white-space: normal; } 应该解决大部分问题。或者使用在其样式中不使用滚动表格的主题。
  • @StevePiercy 成功了,非常感谢!将其发布为答案,我会将其标记为已接受:)
  • 完成,谢谢!

标签: python documentation python-sphinx word-wrap


【解决方案1】:

用您自己的样式覆盖表格上的 CSS。具体来说:

.wy-table-responsive table td,
.wy-table-responsive table th {
  white-space: normal;
}

应该能解决大部分问题。或者使用在其样式中不使用滚动表格的主题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多