Superdesk documentation is written using rst format and generated via Sphinx. It’s organized by topic, using autodoc as much as possible to include docstrings from python code.

When working on docs, you can use live preview. In docs folder with virtualenv enabled run:

$ make livehtml

This will build docs and run a server on localhost:8000. It will refresh as you modify documentation, but not when you modify python docstrings, in order to see some changes done there you still have to make some changes in rst files.

Once you make a PR and it gets merged, you will see updated docs on

Updating docs

Documentation should be added/updated together with code changes in a single PR to superdesk-core repository. There can be also PRs with only documentation.

New topic/module

To add a new topic or module docs, you create a file eg. foo.rst in docs folder and then you have to add it to index.rst toctree. This will make it appear in table of contents in both sidebar and on homepage.

Docs conventions

Again - we should use autodocs as much as possible so that documentation is close to code and thus should get updated with it. Thus to document a class or function, use autoclass and autofunction:

.. autoclass:: apps.publish.content.common.BasePublishService

.. autofunction:: superdesk.publish.transmit

If you want to document multiple classes/functions from same module, you should use automodule or module first:

.. module::

.. autoclass:: ANPAFeedParser
.. autoclass:: IPTC7901FeedParser

If you want to document whole module with all its members, you can just use automodule:

.. automodule::

This will document all public members from the module which have a docstring.

You can integrate UML diagrams using PlantUML syntax, with:

.. uml::

    [plantuml diagram]