I've been working on Debian's (Sandro Tosi's) request to produce a smaller doc tree... If only I had known how much work was involved before I started!
SUMMARY: Since so much has changed in the doc build, I need help testing it in other environments -- particularly because LaTeX docs have never built on my machine. I've done this on the branch, so the Debian guys can run with it, but it's a little risky, due to the depth of cuts I had to make. I've tested successfully with Sphinx 0.5.1 and docutils 0.5. Please clean your checkout and then build for yourself and let me know if you see anything funny.
DETAILS:
You can now do
python make.py --small html
which will only generate low-res PNGs for the html build. "--small" has no effect for pdf build.
The payoff here is that the html tree goes from 109MB to 49MB.
There have been some fundamental changes to how files are staged in the doc build. Rather than dumping everything in _static and then having Sphinx copy them over for us, our various extensions now either a) put the files directly into the build tree under build/html/_images or build/html/pyplot_directive, or b) stage things in build/pyplot_directive, and then copy to the build tree as needed. The exception is the _static/examples directory (generated by gen_rst.py), since they will require some major work to know where the build directory is.
The plot_directive always builds all three versions of every plot (png, hires.png, pdf) into build/pyplot_directive. Depending on a user setting, only some of these may be copied to the output directory. The reason for this is so that switching between html and pdf builds works, and we don't get hundreds of false warnings from sphinx about missing files. It took a while to arrive and that procedure...
gen_gallery now runs in a sphinx callback (env-updated) after all the input files have been parsed, (and all the plots have been generated), but right before the html or latex is written out. This eliminates the need to run the build multiple times, and the need to have an autogenerated file (doc/_templates/gallery.html) in SVN. The thumbnail downsampling is now done as part of this step, rather than as part of plot_directive, since it isn't needed for LaTeX builds.
Something similar should be done for the examples, I just haven't gotten around to it yet.
Lastly, since files are in many different places, the Sourceforge site should probably be cleaned (if it isn't automatically already) to ensure we don't go over quota.
Mike
···
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA