reStructuredText长节标题

时间:2019-06-21 08:38:55

标签: python-sphinx restructuredtext

有什么方法可以在reStructuredText中换行长节标题吗?

我的Linter一直抱怨超过最大行长,这使我发疯。

有问题的章节标题包括:any:个参考,这些参考本质上不能改写得更短。

我已经左右搜索了RST教程,但是没有找到任何语法。

有问题的RST解释器是Python 3.6上的Sphinx v1.8.5。

1 个答案:

答案 0 :(得分:2)

无法在RestructuredText中将部分标题换行。

不过,您可能可以使用RestructuredText Substitutions完成所需的操作。

例如

====================================
This is a |subst| long section title
====================================

.. |subst| replace:: (Insert this very long text,
                     which can even be line-wrapped)