将其他 *.rst 文件中的整个文本部分包含到此文件中?

gla*_*des 7 restructuredtext sections python-sphinx

我正在使用 Sphinx,我想自动将给定部分从一个 *.rst 文件“复制”到多个其他文件中,这样当我调整第一个文件中的文本部分时,更改会自动反映在复制的部分中其他文件。

例如:

基础.rst :

This is a section/paragraph I want to see in other *.rst - files.
Run Code Online (Sandbox Code Playgroud)

导数.rst

Here is some text. But the following paragraph should be the paragraph from above ^^:

<that paragraph from above>

Here the file continues.
Run Code Online (Sandbox Code Playgroud)

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

Ste*_*rcy 6

使用include指令.

Here is some text. But the following paragraph should be the paragraph from above ^^:

.. include:: base.rst

Here the file continues.
Run Code Online (Sandbox Code Playgroud)