From e46f3de4472259010d486c68bc9f0cdd49c6054a Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Tue, 20 Jul 2021 12:45:02 +0200 Subject: [PATCH] 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 --- doc/CMakeLists.txt | 3 --- doc/_scripts/fix_tex.py | 42 ----------------------------------------- 2 files changed, 45 deletions(-) delete mode 100644 doc/_scripts/fix_tex.py diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 24beeae2349..e7b1c8a91bc 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -221,8 +221,6 @@ add_dependencies(html devicetree kconfig) #------------------------------------------------------------------------------- # pdf -set(FIX_TEX_SCRIPT ${ZEPHYR_BASE}/doc/_scripts/fix_tex.py) - add_doc_target( latex COMMAND ${CMAKE_COMMAND} -E env ${SPHINX_ENV} @@ -236,7 +234,6 @@ add_doc_target( ${SPHINXOPTS} ${DOCS_SRC_DIR} ${DOCS_LATEX_DIR} - COMMAND ${PYTHON_EXECUTABLE} ${FIX_TEX_SCRIPT} ${DOCS_LATEX_DIR}/zephyr.tex USES_TERMINAL COMMENT "Running Sphinx LaTeX build..." ) diff --git a/doc/_scripts/fix_tex.py b/doc/_scripts/fix_tex.py deleted file mode 100644 index 07d7a2807b6..00000000000 --- a/doc/_scripts/fix_tex.py +++ /dev/null @@ -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()