Skip to content Skip to sidebar Skip to footer

Include A Text File *as Is* In (python) Sphinx Docs

(using Python-Sphinx Documentation tool) I have a .txt log file I'd like to build into _build/html unaltered. What do I need to alter in conf.py, index.rst, etc. Here is the layou

Solution 1:

I think you can include an external document fragment, as described here:

http://docutils.sourceforge.net/docs/ref/rst/directives.html#including-an-external-document-fragment

From that text, something like this should do it:

.. include:: inclusion.txt
   :literal:

Solution 2:

Solution 3:

You can use the following in sphinx

.. literalinclude:: file.txt
   :text:

It will show the content of the file, as if it were in a code block.

Post a Comment for "Include A Text File *as Is* In (python) Sphinx Docs"