Sphinx autodoc hooks for documenting Invoke-level objects such as tasks.
Unlike most of the rest of Invocations, this module isn’t for reuse in the “import and call functions” sense, but instead acts as a Sphinx extension which allows Sphinx’s autodoc functionality to see and document Invoke tasks and similar Invoke objects.
This functionality is mostly useful for redistributable/reusable tasks
which have been defined as importable members of some Python package or
module, as opposed to “local-only” tasks that live in a single project’s
However, it will work for any tasks that Sphinx autodoc can import, so in a
pinch you could for example tweak
sys.path in your Sphinx
to get it loading up a “local” tasks file for import.
"invocations.autodoc"to your Sphinx
Use Sphinx autodoc’s
automoduledirective normally, aiming it at your tasks module(s), e.g.
.. automodule:: myproject.tasksin some
.rstdocument of your choosing.
As noted above, this only works for modules that are importable, like any other Sphinx autodoc use case.
Unless you want to opt-in which module members get documented, use
"members": Trueto your
By default, only tasks with docstrings will be picked up, unless you also give the
:undoc-members:flag or add
Please see the autodoc docs for details on these settings and more!
Build your docs, and you should see your tasks showing up as documented functions in the result.