I am using Sphinx to generate documentation for my project, and building the documentation as part of the product's install process.
I would like to dynamically include the hostname in the text and/or code-blocks. I have not seen any explanations in the documentation nor any facility for including the output of a shell command or anything other than specific line(s) from a specific file. Does this functionality exist?
To support Markdown-based documentation, Sphinx can use MyST-Parser. MyST-Parser is a Docutils bridge to markdown-it-py, a Python package for parsing the CommonMark Markdown flavor.
.. toctree is a Sphinx-defined directive in which you explicitly list documents whose TOCs will be listed out.
Here are two Sphinx extensions that can do this:
runblock
directives, captures the output and inserts it into documents.program-output
directive and inserts the output into documents.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With