是否将其他*.rst文件中的全部文本部分包含在此文件中



我正在使用狮身人面像,我想"复制";将一个*.rst文件的给定部分自动转换为多个其他文件,这样当我调整第一个文件中的文本部分时,更改会自动反映在其他文件的复制部分中。

例如:

base.rst

This is a section/paragraph I want to see in other *.rst - files.

衍生物.rst

Here is some text. But the following paragraph should be the paragraph from above ^^:
<that paragraph from above>
Here the file continues.

如何使用Sphinx和reStructuredText做到这一点?

使用include指令。

Here is some text. But the following paragraph should be the paragraph from above ^^:
.. include:: base.rst
Here the file continues.

最新更新