ERROR: Unknown directive type "autofunction" etc

2,511 views
Skip to first unread message

DavidA

unread,
Jul 31, 2015, 7:43:55 AM7/31/15
to sphinx-users
Hi

I'm still struggling to get Sphinx working for me to document my Python code.

Here is my index.rst file:

.. MyProj documentation master file, created by
   sphinx-quickstart on Fri Jul 31 11:31:34 2015.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to MyProj documentation!
======================================

Contents:

.. toctree::
   :maxdepth: 2

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

.. currentmodule:: main
.. autofunction:: get_field

.. automodule:: main

.. autoclass:: CSchematic
    :members:

.. automodule:: mygraph

.. autoclass:: CGraph
    :members:

When I run 'make clean' and then 'make html' I see:

Running Sphinx v1.3.1
making output directory...
loading pickled environment... not yet created
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: 1 added, 0 changed, 0 removed
reading sources... [100%] index
C:\PythonDocs\source\index.rst:22: ERROR: Unknown directive type "autofunction".

.. autofunction:: get_field
C:\PythonDocs\source\index.rst:24: ERROR: Unknown directive type "automodule".

.. automodule:: main
C:\PythonDocs\source\index.rst:26: ERROR: Unknown directive type "autoclass".

.. autoclass:: CSchematic
    :members:
C:\PythonDocs\source\index.rst:29: ERROR: Unknown directive type "automodule".

.. automodule:: mygraph
C:\PythonDocs\source\index.rst:31: ERROR: Unknown directive type "autoclass".

.. autoclass:: CGraph
    :members:
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
generating indices... genindex
writing additional pages... search
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded, 5 warnings.

Build finished. The HTML pages are in build/html.

Please could someone suggest why the errors are happening?

Best regards

David

Werner

unread,
Jul 31, 2015, 7:56:34 AM7/31/15
to sphinx...@googlegroups.com
Hi David,
Note sure, but I guess your "extensions" settings in your conf.py is missing autodoc, e.g. mine looks like this:

extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
              'sphinx.ext.intersphinx', 'sphinx.ext.todo',
              'sphinx.ext.ifconfig', 'sphinx.ext.viewcode',
              'sphinx.ext.inheritance_diagram',
              'sphinx.ext.autosummary']


Werner

DavidA

unread,
Jul 31, 2015, 8:00:45 AM7/31/15
to sphinx-users, wern...@gmx.ch
Hi Werner,

Thanks, you are correct - I had forgotten autodoc. It works ok now.

Best regards

David
Reply all
Reply to author
Forward
0 new messages