Opened 13 years ago

# Build the reference manual incrementally — at Version 48

Reported by: Owned by: Mitesh Patel tba major sage-5.8 documentation days38 John Palmieri, Leif Leonhardy, Niles Johnson, Florent Hivert, Mathieu Guay-Paquet, Mike Hansen Mitesh Patel, John Palmieri Volker Braun N/A intersphinx #12016

Building the Sage reference manual can take a significant amount of time. Decreasing this time could speed up Sage development.

The patch is large, but most of it consists of moving files from one location to another, as described below. A summary of the changes:

Changes in doc/en/reference — this is where the size of the patch comes from, although the changes are pretty simple:

• rearrange the directory doc/en/reference: for each file like algebras.rst, create a subdirectory algebras and move algebras.rst to algebras/index.rst. Also create a file algebras/conf.py for the build configuration. All of these new conf.py files are identical. Deal with the contents of the directory reference/media similarly, moving the pictures to the appropriate subdirectory.
• modify reference/index.rst to point to these new files.
• reorganize reference/index.rst so it is arranged, at least somewhat, by topic.
• add intersphinx to conf.py — see below. Also add the new subdirectories to the list exclude_trees.
• new file conf_sub.py, configuration for the pieces of the documentation (as opposed to the main conf.py, which is for building reference/index.rst). This file is imported by each of the files SUBDIRECTORY/conf.py.

Changes to doc/common/builder.py:

• add code to build the reference manual in sections, and also to build the sections in parallel. The reference manual ought to be built twice to resolve references now, so typing "sage -docbuild all html" will build it twice (along with all of the other documents, of course). "sage -docbuild reference html" will just build it once. You can also run "sage -docbuild reference/combinat html", for example, to just build one part of the manual.
• the different parts of the manual are separate documents as far as sphinx is concerned, so allow them to reference each other using the "intersphinx" extension. (This is why we need to build it twice: the first pass assembles the intersphinx databases, the second pass uses the databases to create the references correctly.)
• to accomodate the changes in #11251, which don't seem to be easily compatible with intersphinx, search through the output files looking for "todo" items, and accumulate them in one master "todo" list.
• for pdf format, since it now produces 30 different pdf files, write an html file which links to each of them.

Other changes:

• doc/common/conf.py: add the intersphinx extension to the build process.
• doc/common/themes/sage/layout.html: fix a bug where clicking the Sage logo in the upper left corner of the docs wouldn't take you to the right place, at least in the local documentation.
• doc/common/themes/sageref/: add a new theme for the pieces of the reference manual. This is almost identical to the "sage" theme, except for a little tinkering to the links along the top and bottom lines.
• in the main Sage library, change a few pathnames to media files in the reference manual, since those files have been moved.
• make the necessary changes to .hgignore and MANIFEST.in to deal with the relocated files.

Apply:

• trac_6495-part1-moving-files.patch — this moves 'algebras.rst' to 'algebras/index.rst', and similarly for all other files. It adds .. include:: ../footer.txt to the end of each of these files, and it removes any cross-referencing information like .. _ch:groups:, since that doesn't work anymore with the new structure. It also creates identical files 'DIR/conf.py' in each of the new subdirectories of doc/en/reference, except for doc/en/algebras/conf.py. That file is created in the next patch so that you can focus on reviewing just the second patch.
• trac_6495-part2-everything-else.patch — this does everything else; in other words, all of the important content is in this patch.

Before building the docs, you should delete the documentation output directory: rm -rf SAGE_ROOT/devel/sage/doc/output.

Experimental.

### comment:1 Changed 13 years ago by Mitesh Patel

Authors: → Mitesh Patel John Palmieri added Break up the PDF reference manual into smaller pieces → [with patch, needs work] Break up the PDF reference manual into smaller pieces

The attached patch is experimental. Notes:

• sage -docbuild reference pdf fails to build arithgroup.pdf, apparently because of the math macro \ZZ in the title. Unfortunately, I don't know how to fix this.
• Since it replaces the top level PDF file with several smaller files, it breaks the patch at #4460.
• It's not clear what happens to cross-ReST document links. I'll try to investigate.

### comment:2 Changed 13 years ago by Mitesh Patel

On cross-PDF document links: It seems that Sphinx does not produce these. This may OK, since file:// URLs can break easily.

### comment:3 Changed 13 years ago by Mitesh Patel

On the \ZZ in arithgroup.tex: It seems the problem stems from \@title in

    \ifsphinxpdfoutput
\begingroup
% This \def is required to deal with multi-line authors; it
% changes \\ to ', ' (comma-space), making it pass muster for
% generating document info in the PDF file.
\def\\{, }
\pdfinfo{
/Author (\@author)
/Title (\@title)
}
\endgroup
\fi


in Sphinx's manual.cls. For some reason, the \math* font commands do not work in this context. I gather that \mathbf is preferred, but one workaround is to use

Arithmetic Subgroups of {\rm SL}_2({\bf Z})


in place of

Arithmetic Subgroups of {\rm SL}_2(\ZZ)


in arithgroup.rst.

### Changed 13 years ago by Mitesh Patel

Another approach. Depends on #7549. Still experimental. This patch only. sage repo.

### comment:4 Changed 13 years ago by Mitesh Patel

Priority: minor → major → N/A [with patch, needs work] Break up the PDF reference manual into smaller pieces → Build the reference manual incrementally defect → enhancement

The new patch may make it possible to build and update reference manual chapters semi-independently. I think we can use the intersphinx extension to fix the cross-chapter references. But we'll need to build the manual twice, a la LaTeX.

To build just a chapter, try, e.g.,

sage -docbuild reference/algebras html -juiv3


Still to do:

• Make a combined index page and search page.
• Check that PDF generation works.
• Combine chapter PDF files into one large [optional] PDF file (with pdfjam's pdfjoin)?
• Use a specific LaTeX doc title in each conf.py.
• Fix the "Arithmetic Subgroups" heading on the top-level page.
• Use a visual, 2D layout for the top-level page? Group by general area? Add icons?
• Build docs in parallel (cf. #6255) with multiprocessing?
• Replace the "website" PDF link?
• User-friendliness improvements.
• Encourage more compact chapters? It seems that "Combinatorics" takes the most time and memory.
• ...

### comment:5 Changed 13 years ago by Mitesh Patel

Another important item:

• Use just one _static directory for the manual, not 50+!

### comment:6 Changed 13 years ago by Mitesh Patel

If this approach is viable, I suggest leaving many (most?) of the "To Do" items for other tickets.

### comment:7 Changed 13 years ago by Mitesh Patel

While I'm here:

• Copy PDFs from output/latex/ to output/pdf, so that make all-pdf, at least, doesn't do unnecessary work?

### comment:8 Changed 13 years ago by Mitesh Patel

Description: modified (diff)

### Changed 13 years ago by Mitesh Patel

PDF fixes. This patch only. sage repo.

### comment:9 follow-up:  10 Changed 13 years ago by Mitesh Patel

Sphinx caches "foreign" object inventories in a document's environment.pickle. These now use a lot of disk space.

### comment:10 in reply to:  9 Changed 13 years ago by Mitesh Patel

Sphinx caches "foreign" object inventories in a document's environment.pickle. These now use a lot of disk space.

Another sphinx-dev query.

### comment:12 Changed 11 years ago by John Palmieri

Here's a new patch, rebased to Sage 4.7.1.alpha4. This implements parallel building, and it provides a great speedup, at least on systems with lots of processors. For example, on sage.math, the time to execute sage -docbuild reference html -j went from about 18 minutes to just under 2 minutes. The main idea is to build each module of the reference manual separately, and use the Sphinx intersphinx extension to handle cross-references (so :class:blah will work in the algebras module, even if blah is defined in the rings module).

Remaining issues:

• The new build uses up more disk space than the old, by about 120 megabytes. I don't know if anything can be done about this, and I also don't think it's a big deal. (With the previous patch, it took about 1 gigabyte more, but the more recent patch manages to cut that down: in the previous patch, the _static subdirectory of the documentation was being copied, once for each module of the reference manual, and with the new version, a symlink is used instead.)
• There are now some missing bibliographic references: at some point in the past, people have gone through the documentation and unified the references, but this means that references in one module are not seen by any other. This can be fixed just by copying the references to the module where they're used. For example: CMR05 is referenced somewhere in the module on polynomial rings, but the actual item is described in crypto/mq/sr.py.
• The cross-referencing in intersphinx is not perfect; in particular, it doesn't seem to work after building the documents once, it needs to have the full doctree "inventory" for any module available before resolving references to that module. Since the inventory files are built alongside the documentation, this means it has to be built twice (as far as I can tell) before cross-all of the references work. We could try to figure out dependencies and make sure that if module A is referenced in module B, then A is built first, but that seems complicated, and there is no reason for there not to be circular references. I'm tempted to just allow broken cross-references. For the docs on the web site, we would have to make sure they got built twice.
• There is a main index for the reference manual, but once you click on any entry (like "Cryptography"), you get to that module's index, and there is no link taking you back to the main index. There ought to be a way to fix this, but I haven't figured it out yet.

### comment:13 follow-up:  14 Changed 11 years ago by Volker Braun

Milestone: → sage-4.7.2 → Volker Braun

In an ideal world sphinx would be multithreaded, but we probably shouldn't wait for that ;-) The remaining issues about disk space, bibliographic references, and needing two runs seem to be unavoidable. Building parallel gets more and more important, so I think the benefits outweigh the disadvantages.

I tried the patch on Sage-4.7.1.alpha4 without any other patches applied:

• Only the main page has proper css. For example, html/en/reference/cmd/index.html refers to _static/sage.css but the correct path would be ../_static/sage.css.
• patch conflicts with #11251 (todo extension). Given that the latter is already positively reviewed, maybe this ticket could be rebased on top of it?
• During the sage build, I think we should then run the docbuilder twice for the reference manual. Perhaps this should always be done for sage -docbuild all.
• Can we make output less verbose? The whole intersphinx output scrolled forever off my screen. Ideally, an interspinx failure to find an inventory file would only add one extra line at the end of the build along the lines of "You should re-run docbuild to get references right."

### comment:14 in reply to:  13 Changed 11 years ago by John Palmieri

Authors: Mitesh Patel → Mitesh Patel, John Palmieri → 11251

I tried the patch on Sage-4.7.1.alpha4 without any other patches applied:

• Only the main page has proper css. For example, html/en/reference/cmd/index.html refers to _static/sage.css but the correct path would be ../_static/sage.css.

This was a mistake in the previous version: it was supposed to create a link from reference/_static to reference/cmd/_static. Now it should work.

• patch conflicts with #11251 (todo extension). Given that the latter is already positively reviewed, maybe this ticket could be rebased on top of it?

Good point. This raises another problem: intersphinx doesn't easily pass todo lists between different documents, so I don't know how to get a master todo list for the Sage library. Right now, I've put the todolist for each module after its table of contents. I think combinat is the only module with any actual to do elements.

• During the sage build, I think we should then run the docbuilder twice for the reference manual. Perhaps this should always be done for sage -docbuild all.

Done: sage -docbuild all now builds the reference manual twice. I also added a few print statements to the docbuild process.

• Can we make output less verbose? The whole intersphinx output scrolled forever off my screen. Ideally, an interspinx failure to find an inventory file would only add one extra line at the end of the build along the lines of "You should re-run docbuild to get references right."

I've tried to do this when doing sage -docbuild all and not in general, but it may be suppressing too much output. (In the first pass, all warnings are suppressed, including intersphinx warnings, and in the second pass, any warnings should be printed. But in the second pass, it's just rewriting output, taking intersphinx links into account -- it's not reading the sources a second time, so it doesn't produce warnings about missing bibliographic references.)

Other issues:

• In PDF output, this produces one PDF file for each module, but there is no "master" file linking to them. I hope we can create one. Should it be an html file or a PDF file?
• We could perhaps speed things up more by breaking the combinat module, which is by far the largest, into several pieces. This can happen on another ticket.
• I've reorganized the main index for the reference manual, grouping modules together by topic. I hope it's easier to find things this way. I wonder if we can get intersphinx to produce a master index for all of the documents...
• in the old version, at least on my computer, when I clicked on the Sage logo in the top left corner, it wasn't taking me to the right place. I've fixed that. Along the same lines, with the new reorganization, the other links on the top line look a little funny to me in the reference manual. They looked worse before and I've tried to clean them up, but maybe they could use more work?

### comment:15 Changed 11 years ago by John Palmieri

Description: modified (diff)

### comment:16 Changed 11 years ago by John Palmieri

Status: needs_work → needs_review

Here's a new version of the patch. This still has the same issue with "todo" items: I don't know a way to accumulate all of them from the different Sage modules, so they are just recorded module-by-module. For PDF output, the main documentation page (in SAGE_ROOT/devel/sage/doc/output/html/en/index.html) has the little PDF icons, and now when you click on the one for the reference manual, it actually opens an html file with links to all of the different PDF files.

I'm marking this for review. If we can come up with a good solution for "todo" items, that would be great, but perhaps we could defer it to another ticket.

### comment:17 Changed 11 years ago by John Palmieri

Okay, so this is not the most elegant solution, but in the most recent patch, in the html version of the reference manual, after everything is built, it searches through all of the output files algebra/index.html, arithgroup/index.html, etc., looking for todo lists. When it finds them, it copies them to todolist/index.html. This only works for the html version; for other formats, the todo list file says "The combined to do list is only available in the html version of the reference manual."

### comment:18 Changed 11 years ago by John Palmieri

Here's a new version; the only difference is this change to SAGE_ROOT/devel/sage/spkg-dist:

• ## spkg-dist

diff --git a/spkg-dist b/spkg-dist
 a fi # Remove the .cython_hash file, since including this in the bdist will # completely break "sage -br". # Also, do not distribute these build files (.os and .os); # Also, do not distribute these build files (.so and .os); # it wastes space and causes problems! rm -f .cython_hash c_lib/*.so c_lib/*.os rm -f .cython_hash c_lib/*.so c_lib/*.os # Delete all the autogenerated files, since they will get created again # when SAGE is built or upgraded. cd sage; "$CUR"/spkg-delauto .; cd .. # Delete the autogenerated files in the doc directory. rm -rf doc/output rm -rf doc/en/reference/sage rm -rf doc/en/reference/sagenb rm -rf doc/en/reference/static rm -rf doc/en/reference/templates rm -rf doc/en/reference/*/sage sage/doc/en/reference/*/static sage/doc/en/reference/*/templates # Create the sdist using Python's distutils. python setup.py sdist This makes for a slightly smaller sage-....spkg file, and more importantly, if the old autogenerated files are there, they can confuse the docbuild process. ### comment:19 Changed 11 years ago by John Palmieri Some recent timings on sage.math. Before the patch: $ rm -rf SAGE_ROOT/devel/sage/doc/output
$time sage -docbuild reference html ... real 17m49.313s user 16m57.530s sys 0m45.390s$ rm -rf SAGE_ROOT/devel/sage/doc/output
$time sage -docbuild reference pdf ... real 26m3.623s user 24m40.290s sys 0m43.030s  After the patch: $ rm -rf SAGE_ROOT/devel/sage/doc/output
$time sage -docbuild reference html ... real 2m30.092s user 10m34.900s sys 1m12.590s$ rm -rf SAGE_ROOT/devel/sage/doc/output
$time sage -docbuild reference pdf ... real 3m35.064s user 15m49.790s sys 1m11.070s  ### comment:20 Changed 11 years ago by John Palmieri Question: if you type "sage -docbuild -D" now, it says $ sage -docbuild -D
DOCUMENTs:
de/tutorial          a_tour_of_sage       bordeaux_2008
constructions        developer            faq
installation         numerical_sage       reference
thematic_tutorials   tutorial             website
fr/a_tour_of_sage    fr/tutorial          ru/tutorial
all  (!)
(!) Builds everything.


Should we also mention "reference/MODULE" as a valid target?

### Changed 11 years ago by John Palmieri

use only this patch

### comment:21 Changed 11 years ago by John Palmieri

Description: modified (diff)

### Changed 11 years ago by John Palmieri

use only this patch

### comment:22 Changed 11 years ago by John Palmieri

Dependencies: 11251 → 11251, 11298 modified (diff)

Here's a new version, with #11298 as a new dependency. (It may apply without #11298, perhaps with fuzz.) To help with reviewing, I've broken the patch into two pieces, as explained in the ticket description.

### comment:23 Changed 11 years ago by John Palmieri

Dependencies: 11251, 11298 → #11251, #11298

### comment:24 follow-up:  25 Changed 11 years ago by Robert Bradshaw

Could you post a link to the generated docs so people could browse them?

### comment:25 in reply to:  24 Changed 11 years ago by John Palmieri

Could you post a link to the generated docs so people could browse them?

Good idea:

### comment:28 Changed 11 years ago by Jeroen Demeyer

Dependencies: #11251, #11298

Testing this against sage-4.8.alpha1 + #10620...

### comment:29 Changed 11 years ago by Jeroen Demeyer

Against sage-4.8.alpha1:

patching file doc/en/reference/games/index.rst
Hunk #1 FAILED at 6
1 out of 1 hunks FAILED -- saving rejects to file doc/en/reference/games/index.rst.rej
patching file doc/en/reference/graphs/index.rst
Hunk #1 succeeded at 52 with fuzz 1 (offset 2 lines).
abort: patch failed to apply


### comment:30 Changed 11 years ago by Jeroen Demeyer

Also: I'm not sure whether building totally in parallel should be the default.

### comment:31 Changed 11 years ago by John Palmieri

Here are rebased patches, along with the following change: there is now an environment variable, SAGE_PARALLEL_DOCBUILD, which if set to anything nonempty which doesn't start with "n", causes the reference manual to be built in parallel. I also added "doc-parallel" and "doc-pdf-parallel" targets to the main Makefile with a patch to the root repo.

### comment:32 Changed 11 years ago by John Palmieri

Description: modified (diff)

root repo

### comment:33 Changed 11 years ago by John Palmieri

By the way, the default in the new patch is to build serially. I've also added a brief description of SAGE_PARALLEL_DOCBUILD to the installation guide.

### comment:34 follow-up:  35 Changed 11 years ago by John Palmieri

Description: modified (diff)

Some other possible changes: in the parallel-building code (from builder.py)

            from multiprocessing import Pool, cpu_count
max_cpus = 8 if SAGE_PARALLEL_DOCBUILD else 1
pool = Pool(min(max_cpus, cpu_count()))


perhaps change "else 1" to "else 2"? As it is, building serially (with max_cpus set to 1) is slower than the current system, because in the new system, the manual has to be built twice to resolve cross-references.

We could also change "pool" to just "Pool(cpu_count())" or "Pool(int(1.5 * cpu_count()))" or something like that, eliminating the minimum of 8 and possibly increasing the maximum.

### comment:35 in reply to:  34 ; follow-up:  36 Changed 11 years ago by Jeroen Demeyer

Some other possible changes: in the parallel-building code (from builder.py)

            from multiprocessing import Pool, cpu_count
max_cpus = 8 if SAGE_PARALLEL_DOCBUILD else 1
pool = Pool(min(max_cpus, cpu_count()))


perhaps change "else 1" to "else 2"?

Why? It wouldn't make sense to build with more processes than there are CPUs.

We could also change "pool" to just "Pool(cpu_count())" or "Pool(int(1.5 * cpu_count()))" or something like that, eliminating the minimum of 8 and possibly increasing the maximum.

Why? It wouldn't make sense to build with more processes than there are CPUs.

As I mentioned on sage-devel, I don't like that there is an option to doctest in parallel, a different option to build the docs in parallel, a different option to build in parallel... I would say: let there be one environment variable SAGE_NUM_PROCESSES or something like that and use that for everything.

### comment:36 in reply to:  35 Changed 11 years ago by John Palmieri

Some other possible changes: in the parallel-building code (from builder.py)

            from multiprocessing import Pool, cpu_count
max_cpus = 8 if SAGE_PARALLEL_DOCBUILD else 1
pool = Pool(min(max_cpus, cpu_count()))


perhaps change "else 1" to "else 2"?

Why? It wouldn't make sense to build with more processes than there are CPUs.

This version still does min(max_cpus, cpu_count()), so it won't use more processes than there are CPUs.

We could also change "pool" to just "Pool(cpu_count())" or "Pool(int(1.5 * cpu_count()))" or something like that, eliminating the minimum of 8 and possibly increasing the maximum.

Why? It wouldn't make sense to build with more processes than there are CPUs.

I see lots of suggestions on the internet to set MAKE=make -jN where N is 1.5 * (the number of cpus), or 1 or 2 more than the number of cpus. Why not here as well?

As I mentioned on sage-devel, I don't like that there is an option to doctest in parallel, a different option to build the docs in parallel, a different option to build in parallel... I would say: let there be one environment variable SAGE_NUM_PROCESSES or something like that and use that for everything.

I think maybe two variables: one (SAGE_PARALLEL) to enable parallel processes, one (SAGE_NUM_THREADS) to determine the maximum number of processes. The first could be "no" by default, and the second could be "0" by default, meaning use cpu_count() or min(8, cpu_count()) or some other variant on this, the way we do with NUM_THREADS in Makefile and sage-ptest. Then it's easy to turn on and off without remembering how many cores your machine has.

### comment:37 follow-up:  38 Changed 11 years ago by William Stein

Why not exactly one environment variable "MAKE" which gets set to "make -jN" for some N, and that is it? I suggest this, since that's what I'm used to already for years. I don't claim it is the best solution, but it's in all my .bash* files already, and as John points out above it is documented already all over. Why don't we just stick with it?

### comment:38 in reply to:  37 Changed 11 years ago by John Palmieri

Why not exactly one environment variable "MAKE" which gets set to "make -jN" for some N, and that is it?

That's an interesting idea. See #12016.

### comment:39 follow-ups:  40  41 Changed 11 years ago by John Palmieri

Dependencies: → #12016

Here's a new patch which uses the setting of MAKE to build docs in parallel (or not). It's very similar to the code in sage-ptest from #12016, except that when you run sage-ptest, the assumption should be that you want to work in parallel, so the default number of threads (if MAKE is not set) is min(8, #cpus). For doc building, we shouldn't assume parallel building by default, I guess, so the default number of threads is 1.

### comment:40 in reply to:  39 Changed 11 years ago by Jeroen Demeyer

For doc building, we shouldn't assume parallel building by default, I guess, so the default number of threads is 1.

Indeed!

### comment:41 in reply to:  39 Changed 11 years ago by Jeroen Demeyer

Status: needs_review → needs_work

Here's a new patch which uses the setting of MAKE to build docs in parallel (or not). It's very similar to the code in sage-ptest from #12016, except that when you run sage-ptest, the assumption should be that you want to work in parallel, so the default number of threads (if MAKE is not set) is min(8, #cpus). For doc building, we shouldn't assume parallel building by default, I guess, so the default number of threads is 1.

So then we don't need the environment variable SAGE_PARALLEL_DOCBUILD, nor the Makefile patch, anymore.

### comment:42 Changed 11 years ago by Jeroen Demeyer

With sage-4.8.alpha1, I get

Building reference manual, first pass.

sphinx-build -b html -d /mnt/usb1/scratch/jdemeyer/merger/sage-4.8.alpha2/devel/sage/doc/output/doctrees/en/reference   -A hide_pdf_links=1 -Q  /mnt/usb1/scratch/jdemeyer/merger/sage-4.8.alpha2/devel/sage/doc/en/reference /mnt/usb1/scratch/jdemeyer/merger/sage-4.8.alpha2/devel/sage/doc/output/html/en/reference
Build finished.  The built documents can be found in /mnt/usb1/scratch/jdemeyer/merger/sage-4.8.alpha2/devel/sage/doc/output/html/en/reference
Traceback (most recent call last):
File "/mnt/usb1/scratch/jdemeyer/merger/sage-4.8.alpha2/devel/sage/doc/common/builder.py", line 1332, in <module>
getattr(get_builder(name), type)()
File "/mnt/usb1/scratch/jdemeyer/merger/sage-4.8.alpha2/devel/sage/doc/common/builder.py", line 288, in _wrapper
getattr(get_builder(document), 'html')(*args, **kwds)
File "/mnt/usb1/scratch/jdemeyer/merger/sage-4.8.alpha2/devel/sage/doc/common/builder.py", line 405, in _wrapper
N = re.search('(-j|--jobs[=]?)\s*([0-9]*)', MAKE).groups()[1]
UnboundLocalError: local variable 're' referenced before assignment
make: *** [doc-html] Error 1


### comment:43 Changed 11 years ago by John Palmieri

Description: modified (diff) needs_work → needs_review

So then we don't need the environment variable SAGE_PARALLEL_DOCBUILD, nor the Makefile patch, anymore.

Right, fixed. Also, I added import re into builder.py; this should fix the other problem as well.

### comment:44 Changed 11 years ago by John Palmieri

This now uses SAGE_NUM_THREADS from #12016.

### comment:45 follow-up:  47 Changed 11 years ago by Jeroen Demeyer

Status: needs_review → needs_work

Regarding #12016: you should simply use the value of SAGE_NUM_THREADS, nothing fancier than that.

Regarding spkg-dist: this is essentially a duplicate of #12081 and #12086, so this patch should be removed. In any case, removing the files from MANIFEST.in is the proper way of dealing with this, as opposed to removing the files before packaging the repository. Ideally, sage-sdist should not change the current Sage source tree at all.

What's the rationale for adding all these files to doc/common/themes/sageref?

Instead of always building twice, would it be possible to detect whether the manual has already been built once. For example, if I want both the HTML and PDF documentation, the current patch would do 4 passes, even if 3 would be sufficient.

Last edited 11 years ago by Jeroen Demeyer (previous) (diff)

### comment:46 Changed 11 years ago by Jeroen Demeyer

Last edited 11 years ago by Jeroen Demeyer (previous) (diff)

### comment:47 in reply to:  45 Changed 11 years ago by John Palmieri

Cc: Florent Hivert added sd32 removed → intersphinx

Rebased to 5.0.beta13, but the intersphinx stuff needs fixing (the use of intersphinx here conflicts with the changes in #9128, and I haven't fixed this). Part 1 of the patch was mostly generated automatically using the attached script. After running the script, I removed lines like .. _ch:algebras: (from algebras/index.rst, in this case) by hand.

Regarding #12016: you should simply use the value of SAGE_NUM_THREADS, nothing fancier than that.

Okay, done.

Regarding spkg-dist: this is essentially a duplicate of #12081 and #12086, so this patch should be removed. In any case, removing the files from MANIFEST.in is the proper way of dealing with this, as opposed to removing the files before packaging the repository. Ideally, sage-sdist should not change the current Sage source tree at all.

I removed that part of the patch.

What's the rationale for adding all these files to doc/common/themes/sageref?

The new structure of the reference manual, in particular the new directory structure, means we need new templates for the files coming from reference/algebras/index.rst, as opposed to the old templates, which work for the main file reference/index.rst.

Instead of always building twice, would it be possible to detect whether the manual has already been built once. For example, if I want both the HTML and PDF documentation, the current patch would do 4 passes, even if 3 would be sufficient.

I don't know how to do this.

### comment:48 Changed 11 years ago by John Palmieri

Description: modified (diff)
Note: See TracTickets for help on using tickets.