I'm trying to create my docs with Sphinx, and now on two machines I have the exact same problem: the program-output directive does not work.
I installed Sphinx, then the programoutput extension:
$ sudo pip install sphinxcontrib-programoutput
The installation went fine, documents compile beautifully to nice looking html, but the command-output just doesn't work.
I created a super-simple test case with a file called test.rst
containing a single line:
.. program-output:: python -V
Now when trying to compile this, I get the following output (path abbreviated):
/path/to/test.rst:1: ERROR: Unknown directive type "program-output".
Changing program-output to it's alias command-output doesn't work either (not surprising). I really wonder what I'm doing wrong here. I followed the installation instructions, tried it again and again, reinstalled with an --upgrade
flag, nothing works.
Thanks to bmu I found the problem, indeed I had to add it to the conf.py.
Now the next question: "why is this not in the installation/usage documentation of this extension?" It's not mentioned in http://packages.python.org/sphinxcontrib-programoutput/ which is the first link I get when googling for this extension.
Anyway the complete answer, hope it's useful for other people too:
Go to the document root of your documentation (e.g. ~/Projects/project-name/doc
) where the rest of your documents are.
Edit file conf.py
Look for the line that says extensions = []
(an empty list in my case)
Change this to: extensions = ['sphinxcontrib.programoutput']
And miraculously it suddenly starts to work.
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