Ask Your Question

Revision history [back]

How to build documentation?

I am trying to figure out how to get sphinx to build documentation for a package. I have tried several sample packages from github and always get the same error, so it must be a problem in my personal installation.

For instance, following the instructions to build documentation of these packages:

  • github.com/sagemath/sage_sample/tree/master
  • github.com/mmasdeu/sage_package_template/tree/master
  • github.com/BlackHolePerturbationToolkit/kerrgeodesic_gw/tree/master

I'm eventually asked to run

$ make doc

on the main folder of the package, to which I get

sphinx-build -b html -d build/doctrees   source build/html
Running Sphinx v4.3.2

Extension error:
Could not import extension sage_autodoc (exception: No module named 'sage_autodoc')
make: *** [Makefile:53: html] Error 2

I have SageMath version 9.5, Release Date: 2022-01-30, using Python 3.10.12. I have checked that there is indeed a module called sage_autodoc in my local installation, in the file sage_docbuild/ext/sage_autodoc.py. For some reason, sage is not acknowledging it. Does anyone know how to solve this?