doc: remove fix_tex script
The LaTeX build succeeds without the fix_tex.py script, so remove it. The file actually mentions ".tex file produced by doxygen", so it may not be relevant for Sphinx after all. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
9aedfa676b
commit
e46f3de447
2 changed files with 0 additions and 45 deletions
|
|
@ -221,8 +221,6 @@ add_dependencies(html devicetree kconfig)
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# pdf
|
# pdf
|
||||||
|
|
||||||
set(FIX_TEX_SCRIPT ${ZEPHYR_BASE}/doc/_scripts/fix_tex.py)
|
|
||||||
|
|
||||||
add_doc_target(
|
add_doc_target(
|
||||||
latex
|
latex
|
||||||
COMMAND ${CMAKE_COMMAND} -E env ${SPHINX_ENV}
|
COMMAND ${CMAKE_COMMAND} -E env ${SPHINX_ENV}
|
||||||
|
|
@ -236,7 +234,6 @@ add_doc_target(
|
||||||
${SPHINXOPTS}
|
${SPHINXOPTS}
|
||||||
${DOCS_SRC_DIR}
|
${DOCS_SRC_DIR}
|
||||||
${DOCS_LATEX_DIR}
|
${DOCS_LATEX_DIR}
|
||||||
COMMAND ${PYTHON_EXECUTABLE} ${FIX_TEX_SCRIPT} ${DOCS_LATEX_DIR}/zephyr.tex
|
|
||||||
USES_TERMINAL
|
USES_TERMINAL
|
||||||
COMMENT "Running Sphinx LaTeX build..."
|
COMMENT "Running Sphinx LaTeX build..."
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
#
|
|
||||||
# Copyright (c) 2018, Intel Corporation
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
# Fix the .tex file produced by doxygen
|
|
||||||
# before feeding to pdflatex or latexmk.
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
import re
|
|
||||||
|
|
||||||
def regex_replace(tex_file):
|
|
||||||
patterns = [
|
|
||||||
# runaway argument
|
|
||||||
("}}\r?\n=\r?\n\r?\n\t{6}", "}} = ")
|
|
||||||
]
|
|
||||||
|
|
||||||
f = open(tex_file, mode='r', encoding="utf-8")
|
|
||||||
content = f.read()
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
for p in patterns:
|
|
||||||
content = re.sub(p[0], p[1], content)
|
|
||||||
|
|
||||||
f = open(tex_file, mode='w', encoding="utf-8")
|
|
||||||
f.write(content)
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
def main():
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Fix the .tex file produced '
|
|
||||||
'by doxygen before feeding it to '
|
|
||||||
'latexmk (or pdflatex).')
|
|
||||||
|
|
||||||
parser.add_argument('tex_file', nargs=1)
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
regex_replace(args.tex_file[0])
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
Loading…
Reference in a new issue