TechWriter at work blog logo

TechWriter at work blog

Living and writing documentation at Documatt, small team of programmers that write documentation too.

Error in “xyz” directive: no content permitted#


Sphinx build failed with the error similar to:

WARNING: Error in "image" directive: no content permitted.

.. image::

Image directive can't have an content


Directives (syntax constructs with trailing :: like .. image::, .. toctree::, .. rubric::) may have body called content. Some directives, needs a content, while others can’t have it. If directive don’t expect the content, Sphinx will produce above warning.


For example, image directive don’t expect the content:

.. image::

   Image directive content

For the figure directive, a content is optional:

.. figure::

   Documatt logo

.. figure::

Example of directive that requires content is epigraph:

.. epigraph::

   Epigraph needs content


Consult the documentation if directive accepts a content.