protonpopsicle
protonpopsicle

Reputation: 491

How to get Python Sphinx documentation in data-only format?

I'm working on a very large code base which uses sphinx-apidoc to auto-generate HTML documentation from docstrings in the Python source. The docstrings use the following format:

:param message: message to display
:type message: string
:returns: formatted string
:rtype: string

It's become a requirement to replace the Sphinx HTML documentation with something organized / presented differently--but we still want to auto-generate from our docstrings in source. Is there some way to generate documentation in an intermediary (like xml) format with Sphinx? I've found no way to do this. Anyone know what I might do?

Upvotes: 4

Views: 898

Answers (1)

epc
epc

Reputation: 344

You could use the 'json' builder instead of the HTML builder, which would produce parseable JSON output. Alternate you could write your own builder to create the format you want (see https://www.sphinx-doc.org/en/master/usage/builders/index.html for the current list of builders).

Upvotes: 6

Related Questions