SciTools / iris

A powerful, format-agnostic, and community-driven Python package for analysing and visualising Earth science data
https://scitools-iris.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
629 stars 283 forks source link

DOCS: Adopt autoapi v3 for our API doc generation. #5708

Open tkknight opened 8 months ago

tkknight commented 8 months ago

📚 Documentation

We currently use apidoc for our API Docs, which look like this: https://scitools-iris.readthedocs.io/en/latest/generated/api/iris.html.

Autodoc headline:

Sphinx AutoAPI is a Sphinx extension for generating complete API documentation without needing to load, run, or import the project being documented.

In contrast to the traditional Sphinx autodoc, which requires some manual authoring and uses code imports, AutoAPI finds and generates documentation by parsing source code.

I have locally trialed using autoapi which generally is:

There is a build warning that can be resolved with some investigation but the main issue blocking the adoption is the use of inline comments to document attributes using #: str: this is a comment before the attribute is defined. autoapi works using the triple quotes after the attribute is defined but this would mean changing lots of comments already present and it is limited to a single line.

Lets watch https://github.com/readthedocs/sphinx-autoapi/issues/344 to see if support for #: comments is added, if so we can look at adopting autoapi.

bjlittle commented 8 months ago

@tkknight Should this pull-request be in draft?

bjlittle commented 8 months ago

@tkknight doh! my mistake, this is an issue, all good 😆