Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/src/doc/common/build_options.py
8815 views
1
###############################################
2
# Options for building the Sage documentation #
3
###############################################
4
5
import os, re
6
SAGE_DOC = os.environ['SAGE_DOC']
7
LANGUAGES = [d for d in os.listdir(SAGE_DOC) if re.match('^[a-z][a-z]$', d)]
8
SPHINXOPTS = ""
9
PAPER = ""
10
OMIT = ["introspect"] # docs/dirs to omit when listing and building 'all'
11
12
if PAPER:
13
PAPEROPTS = "-D latex_paper_size=" + PAPER
14
else:
15
PAPEROPTS = ""
16
17
#Note that this needs to have the doctrees dir
18
ALLSPHINXOPTS = SPHINXOPTS + " " + PAPEROPTS + " "
19
WEBSITESPHINXOPTS = ""
20
21
# Number of threads to use for parallel-building the documentation.
22
NUM_THREADS = int(os.environ.get('SAGE_NUM_THREADS', 1))
23
24
# Minimize GAP/libGAP RAM usage in the builder, docbuild already uses too much
25
from sage.interfaces.gap import set_gap_memory_pool_size
26
set_gap_memory_pool_size(0) # will be rounded up to 1M
27
28
INCREMENTAL_BUILD = os.path.exists(os.path.join(SAGE_DOC, 'output'))
29
30