readthedocs / sphinx-autoapi

A new approach to API documentation in Sphinx.
https://sphinx-autoapi.readthedocs.io/
MIT License
415 stars 126 forks source link

How to cross-reference to `sphinx-autoapi` generated pages? #442

Closed michaelweinold closed 1 month ago

michaelweinold commented 1 month ago

How can I cross reference to the documentation of a specific function, which has been generated by sphinx-autoapi? We are using markdown (through the MyST parser) in our documentation - so I am looking for the markdown syntax.

For instance, I would like to link to this function in our documentation from a markdown page.

While it was suggested to use a command along the lines of:

:obj:bw2data.project.ProjectManager.copy_project`

but unfortunately, this did not work - and I could not find any documentation on the obj role in the MyST cross-referencing documentation.

michaelweinold commented 1 month ago
{py:obj}`bw2data.project.ProjectManager.copy_project`

does the trick. Documented here in the Sphinx pages and here in the MyST pages.