summaryrefslogtreecommitdiffstats
path: root/Documentation/conf.py
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2016-08-18 19:22:10 -0400
committerJonathan Corbet <corbet@lwn.net>2016-08-18 19:22:10 -0400
commit5dc6911f16107f7fb3f87369c2eadcb2bee6449a (patch)
treea4c315f24fbc5fc4d79de567c07083dfbb1068dd /Documentation/conf.py
parentcc935bb5969ae16502a940809b4962e948a7aa9c (diff)
parent44f4ddd1bff04196349ab229a6a08e5223fe1594 (diff)
Merge branch 'doc/4.9' into docs-next
Diffstat (limited to 'Documentation/conf.py')
-rw-r--r--Documentation/conf.py66
1 files changed, 55 insertions, 11 deletions
diff --git a/Documentation/conf.py b/Documentation/conf.py
index 5c06b018ad1d..39b9c4a26f6e 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -14,6 +14,11 @@
14 14
15import sys 15import sys
16import os 16import os
17import sphinx
18
19# Get Sphinx version
20major, minor, patch = map(int, sphinx.__version__.split("."))
21
17 22
18# If extensions (or modules to document with autodoc) are in another directory, 23# If extensions (or modules to document with autodoc) are in another directory,
19# add these directories to sys.path here. If the directory is relative to the 24# add these directories to sys.path here. If the directory is relative to the
@@ -31,12 +36,11 @@ from load_config import loadConfig
31# ones. 36# ones.
32extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include'] 37extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include']
33 38
34# Gracefully handle missing rst2pdf. 39# The name of the math extension changed on Sphinx 1.4
35try: 40if minor > 3:
36 import rst2pdf 41 extensions.append("sphinx.ext.imgmath")
37 extensions += ['rst2pdf.pdfbuilder'] 42else:
38except ImportError: 43 extensions.append("sphinx.ext.pngmath")
39 pass
40 44
41# Add any paths that contain templates here, relative to this directory. 45# Add any paths that contain templates here, relative to this directory.
42templates_path = ['_templates'] 46templates_path = ['_templates']
@@ -253,16 +257,56 @@ htmlhelp_basename = 'TheLinuxKerneldoc'
253 257
254latex_elements = { 258latex_elements = {
255# The paper size ('letterpaper' or 'a4paper'). 259# The paper size ('letterpaper' or 'a4paper').
256#'papersize': 'letterpaper', 260'papersize': 'a4paper',
257 261
258# The font size ('10pt', '11pt' or '12pt'). 262# The font size ('10pt', '11pt' or '12pt').
259#'pointsize': '10pt', 263'pointsize': '8pt',
260
261# Additional stuff for the LaTeX preamble.
262#'preamble': '',
263 264
264# Latex figure (float) alignment 265# Latex figure (float) alignment
265#'figure_align': 'htbp', 266#'figure_align': 'htbp',
267
268# Don't mangle with UTF-8 chars
269'inputenc': '',
270'utf8extra': '',
271
272# Additional stuff for the LaTeX preamble.
273 'preamble': '''
274 % Adjust margins
275 \\usepackage[margin=0.5in, top=1in, bottom=1in]{geometry}
276
277 % Allow generate some pages in landscape
278 \\usepackage{lscape}
279
280 % Put notes in gray color and let them be inside a table
281
282 \\definecolor{MyGray}{rgb}{0.80,0.80,0.80}
283
284 \\makeatletter\\newenvironment{graybox}{%
285 \\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\columnwidth}}{\\end{minipage}\\end{lrbox}%
286 \\colorbox{MyGray}{\\usebox{\\@tempboxa}}
287 }\\makeatother
288
289 \\makeatletter
290 \\renewenvironment{notice}[2]{
291 \\begin{graybox}
292 \\bf\\it
293 \\def\\py@noticetype{#1}
294 \\par\\strong{#2}
295 \\csname py@noticestart@#1\\endcsname
296 }
297 {
298 \\csname py@noticeend@\\py@noticetype\\endcsname
299 \\end{graybox}
300 }
301 \\makeatother
302
303 % Use some font with UTF-8 support with XeLaTeX
304 \\usepackage{fontspec}
305 \\setsansfont{DejaVu Serif}
306 \\setromanfont{DejaVu Sans}
307 \\setmonofont{DejaVu Sans Mono}
308
309 '''
266} 310}
267 311
268# Grouping the document tree into LaTeX files. List of tuples 312# Grouping the document tree into LaTeX files. List of tuples