python-sphinx - 在狮身人面像文字中强制换行

标签 python-sphinx restructuredtext

我在源代码中使用以下格式的Sphinx文本:

Line 1 Line 2 Line 3 Line 4

我希望第4行在单独的物理行上以HTML呈现。这可能吗?

最佳答案

您可以如下定义强行换行符:

.. # define a hard line break for HTML
.. |br| raw:: html

   <br />

您应该在prolog.inc中定义此类别名,并在Sphinx配置文件中引用它。

这是一个用法示例:
My first line |br|
My second line

关于python-sphinx - 在狮身人面像文字中强制换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54001054/

相关文章:

python-sphinx - 如何在 python-sphinx 中突出显示文本?

python-sphinx - 如何停止 Sphinx 自动方法用类名作为方法名前缀

python-sphinx - 如何在 Python-sphinx(文档工具)中插入元数据

restructuredtext - reStructuredText 中的内联代码突出显示

restructuredtext - RestructuredText 表中的垂直标题

python - reStructuredText 书目字段正确使用

python - 有没有办法告诉 Sphinx 在不禁用 autodoc 的情况下不要运行模块?

python - Sphinx 文档生成器搜索功能挂起/失败

python - Sphinx 文件间链接函数

python-sphinx - 有选择地禁用 readthedocs 语法突出显示