At this point, I was able to build both HTML and PDF documentation using Sphinx, except for using the output of the DocTests. Then, there are two possibilities: to use asymptote to produce pdf output, or using svg to produce HTML images. Maybe we need to produce both.