Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sphinx: force rebuild of html, including autodoc

Currently, whenever I run sphinx-build, only when there are changes to the source files are the inline docstrings picked up and used. I've tried calling sphinx-build with the -a switch but this seems to have no effect.

How can I force a full rebuild of the HTML output and force autodoc execution?

like image 441
Phillip B Oldham Avatar asked Jan 09 '14 11:01

Phillip B Oldham


People also ask

What is sphinx build?

sphinx-build generates documentation from the files in <sourcedir> and places it in the <outputdir> . sphinx-build looks for <sourcedir>/conf.py for the configuration settings. sphinx-quickstart(1) may be used to generate template files, including conf.py . sphinx-build can create documentation in different formats.

How did the sphinx work?

Sphinx is what is called a documentation generator. This means that it takes a bunch of source files in plain text, and generates a bunch of other awesome things, mainly HTML. For our use case you can think of it as a program that takes in plain text files in reStructuredText format, and outputs HTML.


2 Answers

It seems to work if the -E option is used along with -a. I added it to the html target in my Makefile and now changes in docstrings are picked up without updating any .rst files.

like image 63
J. Katzwinkel Avatar answered Oct 13 '22 00:10

J. Katzwinkel


I do not use sphinx-build but with make html I always do touch *.rst on my source files. Then make html can pickup changes.

like image 23
Darek Avatar answered Oct 12 '22 23:10

Darek