lsst-sqre / documenteer

Sphinx extensions, configurations, and tooling for Rubin Observatory documentation projects
https://documenteer.lsst.io
MIT License
6 stars 3 forks source link

DM-15777: Directive that summarizes a Task's Python API #48

Closed jonathansick closed 6 years ago

jonathansick commented 6 years ago

This PR adds a directive that generates a summary of the Python API for a task class. This is meant to be used in task topic pages to bridge task documentation to the autodoc-generated API reference documentation for the task class.

Usage:

Python API summary
==================

.. lsst-task-api-summary:: lsst.pipe.tasks.assembleCoadd.AssembleCoaddTask
jonathansick commented 6 years ago
screen shot 2018-09-20 at 10 03 59 am

Example showing the API summary where classes and methods are linked to the API docs. The summary for each is also shown. The user is expected to follow the link to get the full parameters and returns etc documentation.

The code block is an affordance that shows where the task is located in the package namespace, and is also copy-and-pastable.

jonathansick commented 6 years ago

Now with an addendum linking to the full API docs. Hopefully this will reinforce the bridge between the task topic and the API topic.

screen shot 2018-09-20 at 10 26 27 am
jonathansick commented 6 years ago

Some additional affordances:

screen shot 2018-09-20 at 11 19 45 am
jonathansick commented 6 years ago

Now including the config attribute and wrapping the addendum link in a seealso admonition node:

screen shot 2018-09-20 at 12 39 32 pm
jonathansick commented 6 years ago

Cleaned up the ellipsis links by make it a more natural extension of the API summary sentence.

screen shot 2018-09-21 at 12 11 25 pm