mirror of
https://git.rtems.org/rtems-docs/
synced 2025-05-15 17:46:49 +08:00
Fix building with Sphinx 1.8 and later.
- Provide the pytnon.ist file for makeindex. - Add support for xelatex building so we can switch if we want too. Closes #3669
This commit is contained in:
parent
2a68e9d425
commit
a3b0a40880
@ -165,6 +165,10 @@ htmlhelp_basename = 'rtemsdoc'
|
|||||||
|
|
||||||
|
|
||||||
# -- Options for LaTeX output --------------------------------------------------
|
# -- Options for LaTeX output --------------------------------------------------
|
||||||
|
latex_engine = 'pdflatex'
|
||||||
|
|
||||||
|
latex_use_xindy = False
|
||||||
|
|
||||||
latex_paper_size = 'a4'
|
latex_paper_size = 'a4'
|
||||||
|
|
||||||
# Grouping the document tree into LaTeX files. List of tuples
|
# Grouping the document tree into LaTeX files. List of tuples
|
||||||
@ -176,6 +180,7 @@ latex_documents = [] # must be overridden in local conf.py
|
|||||||
latex_elements = {
|
latex_elements = {
|
||||||
'papersize': 'a4paper',
|
'papersize': 'a4paper',
|
||||||
'pointsize': '11pt',
|
'pointsize': '11pt',
|
||||||
|
'releasename': '',
|
||||||
'preamble': r'''
|
'preamble': r'''
|
||||||
\newcommand{\rtemscopyright}{%s}
|
\newcommand{\rtemscopyright}{%s}
|
||||||
\usepackage{rtemsstyle}
|
\usepackage{rtemsstyle}
|
||||||
@ -183,11 +188,9 @@ latex_elements = {
|
|||||||
'parsedliteralwraps': True,
|
'parsedliteralwraps': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
latex_additional_files = ['../common/rtemsstyle.sty', '../common/minted.sty', '../common/logo.pdf']
|
latex_additional_files = ['../common/rtemsstyle.sty', '../common/minted.sty', '../common/logo.pdf']
|
||||||
latex_use_modindex = False
|
latex_use_modindex = False
|
||||||
|
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
# the title page.
|
# the title page.
|
||||||
#latex_logo = None
|
#latex_logo = None
|
||||||
@ -204,7 +207,6 @@ latex_show_pagerefs = False
|
|||||||
# If false, no module index is generated.
|
# If false, no module index is generated.
|
||||||
#latex_domain_indices = True
|
#latex_domain_indices = True
|
||||||
|
|
||||||
|
|
||||||
# Example configuration for intersphinx: refer to the Python standard library.
|
# Example configuration for intersphinx: refer to the Python standard library.
|
||||||
#intersphinx_mapping = {'http://docs.python.org/': None}
|
#intersphinx_mapping = {'http://docs.python.org/': None}
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ import sys
|
|||||||
from waflib.Build import BuildContext
|
from waflib.Build import BuildContext
|
||||||
|
|
||||||
import latex
|
import latex
|
||||||
|
import conf
|
||||||
|
|
||||||
sphinx_min_version = (1, 3)
|
sphinx_min_version = (1, 3)
|
||||||
|
|
||||||
@ -221,15 +222,31 @@ def cmd_configure(ctx):
|
|||||||
#
|
#
|
||||||
ctx.env.BUILD_PDF = 'no'
|
ctx.env.BUILD_PDF = 'no'
|
||||||
if ctx.options.pdf:
|
if ctx.options.pdf:
|
||||||
check_tex = not ctx.env.PDFLATEX
|
if conf.latex_engine == 'xelatex':
|
||||||
if check_tex:
|
if not ctx.env.LATEX_CMD:
|
||||||
ctx.load('tex')
|
ctx.load('tex')
|
||||||
if not ctx.env.PDFLATEX or not ctx.env.MAKEINDEX:
|
if not ctx.env.XELATEX or not ctx.env.MAKEINDEX:
|
||||||
ctx.fatal('The programs pdflatex and makeindex are required for PDF output')
|
ctx.fatal('The programs xelatex and makeindex are required for PDF output')
|
||||||
if 'PDFLATEXFLAGS' not in ctx.env or \
|
ctx.env.LATEX_CMD = 'xelatex'
|
||||||
'-shell-escape' not in ctx.env['PDFLATEXFLAGS']:
|
latex.configure_tests(ctx)
|
||||||
ctx.env.append_value('PDFLATEXFLAGS', '-shell-escape')
|
# Minted needs 'shell-escape'
|
||||||
latex.configure_tests(ctx)
|
if 'XELATEXFLAGS' not in ctx.env or \
|
||||||
|
'-shell-escape' not in ctx.env['XELATEXFLAGS']:
|
||||||
|
ctx.env.append_value('XELATEXFLAGS', '-shell-escape')
|
||||||
|
ctx.env.append_value('MAKEINDEXFLAGS', ['-s', 'python.ist'])
|
||||||
|
elif conf.latex_engine == 'pdflatex':
|
||||||
|
if not ctx.env.LATEX_CMD:
|
||||||
|
ctx.load('tex')
|
||||||
|
if not ctx.env.PDFLATEX or not ctx.env.MAKEINDEX:
|
||||||
|
ctx.fatal('The programs pdflatex and makeindex are required for PDF output')
|
||||||
|
if 'PDFLATEXFLAGS' not in ctx.env or \
|
||||||
|
'-shell-escape' not in ctx.env['PDFLATEXFLAGS']:
|
||||||
|
ctx.env.append_value('PDFLATEXFLAGS', '-shell-escape')
|
||||||
|
ctx.env.append_value('MAKEINDEXFLAGS', ['-s', 'python.ist'])
|
||||||
|
ctx.env.LATEX_CMD = 'pdflatex'
|
||||||
|
latex.configure_tests(ctx)
|
||||||
|
else:
|
||||||
|
ctx.fatal('Unsupported latex engine: %s' % (conf.latex_engine))
|
||||||
ctx.env.BUILD_PDF = 'yes'
|
ctx.env.BUILD_PDF = 'yes'
|
||||||
|
|
||||||
ctx.envBUILD_SINGLEHTML = 'no'
|
ctx.envBUILD_SINGLEHTML = 'no'
|
||||||
@ -286,7 +303,7 @@ def doc_pdf(ctx, source_dir, conf_dir, extra_source):
|
|||||||
ctx(
|
ctx(
|
||||||
features = 'tex',
|
features = 'tex',
|
||||||
cwd = output_dir,
|
cwd = output_dir,
|
||||||
type = 'pdflatex',
|
type = ctx.env.LATEX_CMD,
|
||||||
source = "%s/%s.tex" % (buildtype, ctx.path.name),
|
source = "%s/%s.tex" % (buildtype, ctx.path.name),
|
||||||
prompt = 0
|
prompt = 0
|
||||||
)
|
)
|
||||||
@ -384,7 +401,7 @@ def images_plantuml(ctx, source_dir, conf_dir, ext):
|
|||||||
source = src,
|
source = src,
|
||||||
target = tgt,
|
target = tgt,
|
||||||
install_path = None
|
install_path = None
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def cmd_build(ctx, extra_source = []):
|
def cmd_build(ctx, extra_source = []):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user