Issue
I am writing the docstrings in rst
format for a Python package where a piece of text repeats at multiple locations. I want to keep this common text in a separate file and include it wherever it appears. This is to make the maintenance easier.
Solution
You can use the include
directive:
The "include" directive reads a text file. The directive argument is the path to the file to be included, relative to the document containing the directive. Unless the options literal, code, or parser are given, the file is parsed in the current document's context at the point of the directive. For example:
.. include:: inclusion.txt
Answered By - Selcuk
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.