Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: conf.py: use dedent and r-strings for LaTeX macros

Instead of adding extra weird indentation at the tex
file, use dedent(). While here, also use r-strings, to make
easier to make its content identical to the .tex output.

While here, also merge "preamble" that was added on two
separate parts of the code (in the past, there were some
version-specific checks).

No functional changes, just cosmetic ones.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/0d245fbd872ab3ec21bd8fe78b01340ba77ce365.1755763127.git.mchehab+huawei@kernel.org

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
e7880da7 9fd4e4ce

+12 -14
+12 -14
Documentation/conf.py
··· 9 9 import shutil 10 10 import sys 11 11 12 + from textwrap import dedent 13 + 12 14 import sphinx 13 15 14 16 # If extensions (or modules to document with autodoc) are in another directory, ··· 464 462 "inputenc": "", 465 463 "utf8extra": "", 466 464 # Set document margins 467 - "sphinxsetup": """ 465 + "sphinxsetup": dedent(r""" 468 466 hmargin=0.5in, vmargin=1in, 469 467 parsedliteralwraps=true, 470 468 verbatimhintsturnover=false, 471 - """, 469 + """), 472 470 # 473 471 # Some of our authors are fond of deep nesting; tell latex to 474 472 # cope. ··· 477 475 # For CJK One-half spacing, need to be in front of hyperref 478 476 "extrapackages": r"\usepackage{setspace}", 479 477 # Additional stuff for the LaTeX preamble. 480 - "preamble": """ 478 + "preamble": dedent(r""" 481 479 % Use some font with UTF-8 support with XeLaTeX 482 - \\usepackage{fontspec} 483 - \\setsansfont{DejaVu Sans} 484 - \\setromanfont{DejaVu Serif} 485 - \\setmonofont{DejaVu Sans Mono} 486 - """, 487 - } 488 - 489 - # Load kerneldoc specific LaTeX settings 490 - latex_elements["preamble"] += """ 480 + \usepackage{fontspec} 481 + \setsansfont{DejaVu Sans} 482 + \setromanfont{DejaVu Serif} 483 + \setmonofont{DejaVu Sans Mono} 491 484 % Load kerneldoc specific LaTeX settings 492 - \\input{kerneldoc-preamble.sty} 493 - """ 485 + \input{kerneldoc-preamble.sty} 486 + """) 487 + } 494 488 495 489 # This will be filled up by config-inited event 496 490 latex_documents = []