From 30d0d2cf4ec8c55186c56b3f9923e3c682d4da47 Mon Sep 17 00:00:00 2001 From: TunaLobster Date: Thu, 14 Jul 2022 14:16:40 -0500 Subject: [PATCH 1/3] Add support for sphinx latexpdf builder --- .gitignore | 1 + Sphinxsetup.sh | 2 +- antennatracker/source/conf.py | 6 ++-- ardupilot/source/conf.py | 4 +-- blimp/source/conf.py | 6 ++-- copter/source/conf.py | 6 ++-- dev/source/conf.py | 9 ++++-- mavproxy/source/conf.py | 6 ++-- plane/source/conf.py | 6 ++-- planner/source/conf.py | 6 ++-- planner2/source/conf.py | 6 ++-- rover/source/conf.py | 6 ++-- update.py | 60 +++++++++++++++++++++++++---------- 13 files changed, 77 insertions(+), 47 deletions(-) diff --git a/.gitignore b/.gitignore index 7b4fcdadad..734b226ed6 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ # Any build directory */build/* +*/_build/* # Logs *.log diff --git a/Sphinxsetup.sh b/Sphinxsetup.sh index 71c4a2b882..0cd238b925 100755 --- a/Sphinxsetup.sh +++ b/Sphinxsetup.sh @@ -16,7 +16,7 @@ if [ ${DISTRIBUTION_ID} = 'Ubuntu' ]; then fi sudo apt-get -y update -sudo apt-get install -y unzip git imagemagick curl wget make python3 +sudo apt-get install -y unzip git imagemagick curl wget make python3 texlive-latex-recommended texlive-fonts-recommended tex-gyre texlive-latex-extra latexmk fonts-freefont-otf # Install packages release specific if [ ${DISTRIBUTION_CODENAME} = 'bionic' ]; then diff --git a/antennatracker/source/conf.py b/antennatracker/source/conf.py index a1e376e32f..d593eea1d3 100644 --- a/antennatracker/source/conf.py +++ b/antennatracker/source/conf.py @@ -241,7 +241,7 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'ArduPilot.tex', u'ArduPilot Documentation', + (master_doc, 'ArduPilotAntennaTracker.tex', u'ArduPilot Antenna Tracker Documentation', u'ArduPilot Dev Team', 'manual'), ] @@ -251,10 +251,10 @@ # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -# latex_use_parts = False +latex_use_parts = True # If true, show page references after internal links. -# latex_show_pagerefs = False +latex_show_pagerefs = True # If true, show URL addresses after external links. # latex_show_urls = False diff --git a/ardupilot/source/conf.py b/ardupilot/source/conf.py index 63f7befae1..fef954037a 100644 --- a/ardupilot/source/conf.py +++ b/ardupilot/source/conf.py @@ -247,10 +247,10 @@ # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -# latex_use_parts = False +latex_use_parts = True # If true, show page references after internal links. -# latex_show_pagerefs = False +latex_show_pagerefs = True # If true, show URL addresses after external links. # latex_show_urls = False diff --git a/blimp/source/conf.py b/blimp/source/conf.py index 3db6f3f7b3..585e2b5f68 100644 --- a/blimp/source/conf.py +++ b/blimp/source/conf.py @@ -244,7 +244,7 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'ArduPilot.tex', u'ArduPilot Documentation', + (master_doc, 'ArduPilotBlimp.tex', u'ArduPilot Documentation', u'ArduPilot Dev Team', 'manual'), ] @@ -254,10 +254,10 @@ # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -# latex_use_parts = False +latex_use_parts = True # If true, show page references after internal links. -# latex_show_pagerefs = False +latex_show_pagerefs = True # If true, show URL addresses after external links. # latex_show_urls = False diff --git a/copter/source/conf.py b/copter/source/conf.py index e7116866dc..5eae567e0e 100644 --- a/copter/source/conf.py +++ b/copter/source/conf.py @@ -244,7 +244,7 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'ArduPilot.tex', u'ArduPilot Documentation', + (master_doc, 'ArduPilotCopter.tex', u'ArduPilot Copter Documentation', u'ArduPilot Dev Team', 'manual'), ] @@ -254,10 +254,10 @@ # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -# latex_use_parts = False +latex_use_parts = True # If true, show page references after internal links. -# latex_show_pagerefs = False +latex_show_pagerefs = True # If true, show URL addresses after external links. # latex_show_urls = False diff --git a/dev/source/conf.py b/dev/source/conf.py index 881c365dc4..0151cf0f40 100644 --- a/dev/source/conf.py +++ b/dev/source/conf.py @@ -233,11 +233,14 @@ # 'figure_align': 'htbp', } +# Default engine is pdflatex +latex_engine = 'xelatex' + # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'ArduPilot.tex', u'ArduPilot Documentation', + (master_doc, 'ArduPilotDev.tex', u'ArduPilot Developer Documentation', u'ArduPilot Dev Team', 'manual'), ] @@ -247,10 +250,10 @@ # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -# latex_use_parts = False +latex_use_parts = True # If true, show page references after internal links. -# latex_show_pagerefs = False +latex_show_pagerefs = True # If true, show URL addresses after external links. # latex_show_urls = False diff --git a/mavproxy/source/conf.py b/mavproxy/source/conf.py index 3e501d4249..02525806cc 100644 --- a/mavproxy/source/conf.py +++ b/mavproxy/source/conf.py @@ -237,7 +237,7 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'ArduPilot.tex', u'ArduPilot Documentation', + (master_doc, 'ArduPilotMAVProxy.tex', u'ArduPilot MAVProxy Documentation', u'ArduPilot Dev Team', 'manual'), ] @@ -247,10 +247,10 @@ # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -# latex_use_parts = False +latex_use_parts = True # If true, show page references after internal links. -# latex_show_pagerefs = False +latex_show_pagerefs = True # If true, show URL addresses after external links. # latex_show_urls = False diff --git a/plane/source/conf.py b/plane/source/conf.py index 3268a5b4e1..1dfc38b592 100644 --- a/plane/source/conf.py +++ b/plane/source/conf.py @@ -243,7 +243,7 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'ArduPilot.tex', u'ArduPilot Documentation', + (master_doc, 'ArduPilotPlane.tex', u'ArduPilot Plane Documentation', u'ArduPilot Dev Team', 'manual'), ] @@ -253,10 +253,10 @@ # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -# latex_use_parts = False +latex_use_parts = True # If true, show page references after internal links. -# latex_show_pagerefs = False +latex_show_pagerefs = True # If true, show URL addresses after external links. # latex_show_urls = False diff --git a/planner/source/conf.py b/planner/source/conf.py index d381c29231..ae027ebf6d 100644 --- a/planner/source/conf.py +++ b/planner/source/conf.py @@ -237,7 +237,7 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'ArduPilot.tex', u'ArduPilot Documentation', + (master_doc, 'ArduPilotPlanner.tex', u'ArduPilot Planner Documentation', u'ArduPilot Dev Team', 'manual'), ] @@ -247,10 +247,10 @@ # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -# latex_use_parts = False +latex_use_parts = True # If true, show page references after internal links. -# latex_show_pagerefs = False +latex_show_pagerefs = True # If true, show URL addresses after external links. # latex_show_urls = False diff --git a/planner2/source/conf.py b/planner2/source/conf.py index 2085750181..aa9050c751 100644 --- a/planner2/source/conf.py +++ b/planner2/source/conf.py @@ -237,7 +237,7 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'ArduPilot.tex', u'ArduPilot Documentation', + (master_doc, 'ArduPilotPlanner2.tex', u'ArduPilot APM Planner 2 Documentation', u'ArduPilot Dev Team', 'manual'), ] @@ -247,10 +247,10 @@ # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -# latex_use_parts = False +latex_use_parts = True # If true, show page references after internal links. -# latex_show_pagerefs = False +latex_show_pagerefs = True # If true, show URL addresses after external links. # latex_show_urls = False diff --git a/rover/source/conf.py b/rover/source/conf.py index 2f31cba19d..47d2062453 100644 --- a/rover/source/conf.py +++ b/rover/source/conf.py @@ -239,7 +239,7 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'ArduPilot.tex', u'ArduPilot Documentation', + (master_doc, 'ArduPilotRover.tex', u'ArduPilot Rover Documentation', u'ArduPilot Dev Team', 'manual'), ] @@ -249,10 +249,10 @@ # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -# latex_use_parts = False +latex_use_parts = True # If true, show page references after internal links. -# latex_show_pagerefs = False +latex_show_pagerefs = True # If true, show URL addresses after external links. # latex_show_urls = False diff --git a/update.py b/update.py index a5a3a69adc..3b9f3016a8 100755 --- a/update.py +++ b/update.py @@ -84,6 +84,7 @@ # GIT_REPO = '' + PARAMETER_SITE = { 'rover': 'APMrover2', 'copter': 'ArduCopter', @@ -140,7 +141,7 @@ def fetch_url(fetchurl): subprocess.check_call(["wget", fetchurl]) -def fetchparameters(site=None, cache=None): +def fetchparameters(site=None, cache=None, pdf=None): """Fetches the parameters for all the sites from the test server and copies them to the correct location. @@ -156,6 +157,8 @@ def fetchparameters(site=None, cache=None): targetfile = './%s/source/docs/parameters.rst' % key if key == 'AP_Periph': targetfile = './dev/source/docs/AP_Periph-Parameters.rst' + if pdf: + fetchurl = 'https://autotest.ardupilot.org/Parameters/%s/ParametersLatex.rst' % value # noqa" if cache: if not os.path.exists(targetfile): raise Exception("Asked to use cached parameter files, but (%s) does not exist" % (targetfile,)) @@ -166,7 +169,10 @@ def fetchparameters(site=None, cache=None): # move in new file if os.path.exists(targetfile): os.unlink(targetfile) - os.rename('Parameters.rst', targetfile) + if pdf: + os.rename('ParametersLatex.rst', targetfile) + else: + os.rename('Parameters.rst', targetfile) def fetchlogmessages(site=None, cache=None): @@ -192,23 +198,29 @@ def fetchlogmessages(site=None, cache=None): os.rename('LogMessages.rst', targetfile) -def build_one(wiki, fast): +def build_one(wiki, fast, no_html, pdf): '''build one wiki''' debug('Using make for sphinx: %s' % wiki) + # default to building on Linux + buildcommand = ["nice", "make"] + useshell = False if platform.system() == "Windows": + buildcommand = ["make.bat"] + useshell = True # This will fail if there's no folder to clean, so no check_call here - if not fast: - subprocess.run(["make.bat", "clean"], cwd=wiki, shell=True) - subprocess.check_call(["make.bat", "html"], cwd=wiki, shell=True) - else: - if not fast: - subprocess.check_call(["nice", "make", "clean"], cwd=wiki) - subprocess.check_call(["nice", "make", "html"], cwd=wiki) + subprocess.run(buildcommand + ["clean"], cwd=wiki, shell=useshell) + if not fast: + subprocess.check_call(buildcommand + ["clean"], cwd=wiki, shell=useshell) + if not no_html: + subprocess.check_call( + buildcommand + ["html"], cwd=wiki, shell=useshell) + if pdf: + subprocess.check_call(buildcommand + ["latexpdf", r'LATEXMKOPTS="-silent"'], cwd=wiki, shell=useshell) -def sphinx_make(site, parallel, fast): +def sphinx_make(site, parallel, fast, no_html, pdf): """ - Calls 'make html' to build each site + Calls 'make html' or 'make latexpdf' to build each site """ done = set() wikis = set(ALL_WIKIS[:]) @@ -223,7 +235,7 @@ def sphinx_make(site, parallel, fast): continue if site is not None and not site == wiki: continue - p = multiprocessing.Process(target=build_one, args=(wiki, fast)) + p = multiprocessing.Process(target=build_one, args=(wiki, fast, no_html, pdf)) p.start() procs.append(p) while parallel != -1 and len(procs) >= parallel: @@ -1026,6 +1038,20 @@ def create_features_page(features, build_options_by_define, vehicletype): help=("Incremental build using already downloaded parameters, log messages, and video thumbnails rather than cleaning " "before build."), ) + parser.add_argument( + '--no-html', + dest='no_html', + action='store_true', + default=False, + help="Disable html output", + ) + parser.add_argument( + '--pdf', + dest='pdf', + action='store_true', + default=False, + help="Enable pdf output", + ) args = parser.parse_args() # print(args.site) @@ -1046,14 +1072,14 @@ def create_features_page(features, build_options_by_define, vehicletype): fetch_versioned_parameters(args.site) else: # Single parameters file. Just present the latest parameters: - fetchparameters(args.site, args.cached_parameter_files) + fetchparameters(args.site, args.cached_parameter_files, args.pdf) - # Fetch most recent LogMessage metadata from autotest: - fetchlogmessages(args.site, args.cached_parameter_files) + # Fetch most recent LogMessage metadata from autotest: + fetchlogmessages(args.site, args.cached_parameter_files) copy_static_html_sites(args.site, args.destdir) generate_copy_dict() - sphinx_make(args.site, args.parallel, args.fast) + sphinx_make(args.site, args.parallel, args.fast, args.no_html, args.pdf) if args.paramversioning: put_cached_parameters_files_in_sites(args.site) From f233a15e3e275abc6667ef0a01294485f1d01103 Mon Sep 17 00:00:00 2001 From: TunaLobster Date: Thu, 1 Sep 2022 13:56:50 -0500 Subject: [PATCH 2/3] Fix latex build warnings --- .../docs/common-installing-3dr-ublox-gps-compass-module.rst | 2 -- ...otal-energy-control-system-for-speed-height-tuning-guide.rst | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/common/source/docs/common-installing-3dr-ublox-gps-compass-module.rst b/common/source/docs/common-installing-3dr-ublox-gps-compass-module.rst index 721c0697ae..5b20fb918a 100644 --- a/common/source/docs/common-installing-3dr-ublox-gps-compass-module.rst +++ b/common/source/docs/common-installing-3dr-ublox-gps-compass-module.rst @@ -15,8 +15,6 @@ ArduPilot automatically configures the GPS soon after startup so there is no nee Connecting the Autopilot ======================== -.. _common-installing-3dr-ublox-gps-compass-module_connecting_to_pixhawk: - .. image:: ../../../images/gps-connection.jpg :target: ../_iamges/gps-connection.jpg diff --git a/plane/source/docs/tecs-total-energy-control-system-for-speed-height-tuning-guide.rst b/plane/source/docs/tecs-total-energy-control-system-for-speed-height-tuning-guide.rst index 1ca1af0c6f..419916083f 100644 --- a/plane/source/docs/tecs-total-energy-control-system-for-speed-height-tuning-guide.rst +++ b/plane/source/docs/tecs-total-energy-control-system-for-speed-height-tuning-guide.rst @@ -164,7 +164,7 @@ Flight Testing or the maximum sink rate :ref:`TECS_SINK_MAX` needs to be reduced. If the height response oscillates you can try increasing the value of -`TECS_PTCH_DAMP <#TECS_PTCH_DAMP>`__ in increments of 0.1 (don't go +:ref:`TECS_PTCH_DAMP` in increments of 0.1 (don't go above 0.5 unless you know how to check for excessive noise in the nav_pitch signal using the mission planner tuning window) and then try increasing the value of :ref:`TECS_TIME_CONST` in increments of 1.0. From 18170f86e5fe6947e81f04538e863e06dc67455e Mon Sep 17 00:00:00 2001 From: TunaLobster Date: Sun, 11 Jun 2023 12:05:02 -0500 Subject: [PATCH 3/3] Attempt to fix copter pdf build --- .github/workflows/test.yml | 11 +++++++---- Sphinxsetup.sh | 20 ++++---------------- antennatracker/source/conf.py | 3 +++ ardupilot/source/conf.py | 3 +++ common_conf.py | 3 +++ copter/source/conf.py | 2 ++ dev/source/conf.py | 6 +++--- mavproxy/source/conf.py | 3 +++ plane/source/conf.py | 2 ++ planner/source/conf.py | 3 +++ planner2/source/conf.py | 3 +++ rover/source/conf.py | 3 +++ update.py | 21 ++++++++++++++------- 13 files changed, 53 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8039b3754f..ad34822acb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,14 +17,14 @@ jobs: python-version: ["3.8", "3.10"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - name: Setting environment run: | - mkdir /tmp/web + mkdir /tmp/web /tmp/pdf ./Sphinxsetup.sh - name: Check image formats run: | @@ -33,6 +33,9 @@ jobs: run : | set -eux -o pipefail flake8 . - - name: Test build + - name: Test html build run: | ./update.py --parallel 4 --verbose --destdir=/tmp/web + - name: Test pdf build + run: | + ./update.py --parallel 4 --verbose --destdir=/tmp/pdf --no-html --pdf diff --git a/Sphinxsetup.sh b/Sphinxsetup.sh index 0cd238b925..c6e51416eb 100755 --- a/Sphinxsetup.sh +++ b/Sphinxsetup.sh @@ -46,24 +46,12 @@ rm -f get-pip.py # Install sphinx with a specific docutils version # Docutils version is for correct bullet point rendering. Can be rolled forward after theme is updated to >=0.5.1 # See https://stackoverflow.com/a/68685753/2578171 -python3 -m pip install --user --upgrade sphinx==5.1.1 docutils==0.16 - -# lxml for parameter parsing: -python3 -m pip install --user --upgrade lxml - +# lxml for parameter parsing # Install sphinx theme from ArduPilot repository -python3 -m pip install --user --upgrade git+https://github.com/ArduPilot/sphinx_rtd_theme.git - -# and youtube and video plugins: -# This command might require a --force option if you have and older extension installed -# Rerun Sphinxsetup.sh after doing that -python3 -m pip install --user --upgrade git+https://github.com/ArduPilot/sphinxcontrib-youtube.git - +# and youtube and video plugins (might require a --force option if you have an older extension installed. Rerun Sphinxsetup.sh after doing that) # and a parser to use getting posts from Discourse (forum) and insert in FrontEnd -python3 -m pip install --user --upgrade beautifulsoup4 - -# Install flake8 -python3 -m pip install --user --upgrade flake8==3.7.9 +# and flake8 +python3 -m pip install --user --upgrade "sphinx>=5" lxml git+https://github.com/ArduPilot/sphinx_rtd_theme.git git+https://github.com/ArduPilot/sphinxcontrib-youtube.git beautifulsoup4 flake8==3.7.9 # Reset the value of DISPLAY if grep -qi -E '(Microsoft|WSL)' /proc/version; then diff --git a/antennatracker/source/conf.py b/antennatracker/source/conf.py index d593eea1d3..df1ea92f08 100644 --- a/antennatracker/source/conf.py +++ b/antennatracker/source/conf.py @@ -223,6 +223,9 @@ # -- Options for LaTeX output --------------------------------------------- +# Default engine is pdflatex +latex_engine = 'xelatex' + latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', diff --git a/ardupilot/source/conf.py b/ardupilot/source/conf.py index fef954037a..e8ea27e14f 100644 --- a/ardupilot/source/conf.py +++ b/ardupilot/source/conf.py @@ -219,6 +219,9 @@ # -- Options for LaTeX output --------------------------------------------- +# Default engine is pdflatex +latex_engine = 'xelatex' + latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', diff --git a/common_conf.py b/common_conf.py index 7c75affdd5..a79bd5fb4f 100644 --- a/common_conf.py +++ b/common_conf.py @@ -27,6 +27,9 @@ intersphinx_base_url = wiki_base_url + '%s/' +# Default engine is pdflatex +latex_engine = 'pdflatex' + # Where to point the base of the build for the main site menu html_context = {'target': '/'} # This needs to change to the actual URL root once the theme updated. diff --git a/copter/source/conf.py b/copter/source/conf.py index 5eae567e0e..0b70f803dd 100644 --- a/copter/source/conf.py +++ b/copter/source/conf.py @@ -226,6 +226,8 @@ # -- Options for LaTeX output --------------------------------------------- +latex_engine = common_conf.latex_engine + latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', diff --git a/dev/source/conf.py b/dev/source/conf.py index 0151cf0f40..ea93040e66 100644 --- a/dev/source/conf.py +++ b/dev/source/conf.py @@ -219,6 +219,9 @@ # -- Options for LaTeX output --------------------------------------------- +# Default engine is pdflatex +latex_engine = 'xelatex' + latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', @@ -233,9 +236,6 @@ # 'figure_align': 'htbp', } -# Default engine is pdflatex -latex_engine = 'xelatex' - # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). diff --git a/mavproxy/source/conf.py b/mavproxy/source/conf.py index 02525806cc..d27487c0c0 100644 --- a/mavproxy/source/conf.py +++ b/mavproxy/source/conf.py @@ -219,6 +219,9 @@ # -- Options for LaTeX output --------------------------------------------- +# Default engine is pdflatex +latex_engine = 'xelatex' + latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', diff --git a/plane/source/conf.py b/plane/source/conf.py index 1dfc38b592..ee6dc146a6 100644 --- a/plane/source/conf.py +++ b/plane/source/conf.py @@ -225,6 +225,8 @@ # -- Options for LaTeX output --------------------------------------------- +latex_engine = common_conf.latex_engine + latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', diff --git a/planner/source/conf.py b/planner/source/conf.py index ae027ebf6d..573341125a 100644 --- a/planner/source/conf.py +++ b/planner/source/conf.py @@ -219,6 +219,9 @@ # -- Options for LaTeX output --------------------------------------------- +# Default engine is pdflatex +latex_engine = 'xelatex' + latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', diff --git a/planner2/source/conf.py b/planner2/source/conf.py index aa9050c751..679253b3b5 100644 --- a/planner2/source/conf.py +++ b/planner2/source/conf.py @@ -219,6 +219,9 @@ # -- Options for LaTeX output --------------------------------------------- +# Default engine is pdflatex +latex_engine = 'xelatex' + latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', diff --git a/rover/source/conf.py b/rover/source/conf.py index 47d2062453..0a8d879598 100644 --- a/rover/source/conf.py +++ b/rover/source/conf.py @@ -221,6 +221,9 @@ # -- Options for LaTeX output --------------------------------------------- +# Default engine is pdflatex +latex_engine = 'xelatex' + latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', diff --git a/update.py b/update.py index 3b9f3016a8..761df3a66a 100755 --- a/update.py +++ b/update.py @@ -215,7 +215,8 @@ def build_one(wiki, fast, no_html, pdf): subprocess.check_call( buildcommand + ["html"], cwd=wiki, shell=useshell) if pdf: - subprocess.check_call(buildcommand + ["latexpdf", r'LATEXMKOPTS="-silent"'], cwd=wiki, shell=useshell) + # using .run for now until build errors in the wiki can be cleaned up + subprocess.run(buildcommand + ["latexpdf", r'LATEXMKOPTS="-silent"'], cwd=wiki, shell=useshell) def sphinx_make(site, parallel, fast, no_html, pdf): @@ -256,7 +257,7 @@ def sphinx_make(site, parallel, fast, no_html, pdf): time.sleep(0.1) -def check_build(site): +def check_build(site, no_html, pdf): """ check that build was successful """ @@ -268,9 +269,15 @@ def check_build(site): continue if wiki in ['common', 'frontend']: continue - index_html = os.path.join(wiki, "build", "html", "index.html") - if not os.path.exists(index_html): - fatal("%s site not built - missing %s" % (wiki, index_html)) + if not no_html: + index_html = os.path.join(wiki, "build", "html", "index.html") + if not os.path.exists(index_html): + fatal(f"{wiki} site not built - missing {index_html}") + if pdf: + pdf_path = os.path.join(wiki, "build", "latex", "*.pdf") + pdf_path_glob = glob.glob(pdf_path) + if len(pdf_path_glob) != 1: + fatal(f"{wiki} site not built - missing {pdf_path}") def copy_build(site, destdir): @@ -789,7 +796,7 @@ def check_imports(): '''check key imports work''' import pkg_resources # package names to check the versions of. Note that these can be different than the string used to import the package - requires = ["sphinx_rtd_theme>=1.0.0", "sphinxcontrib.youtube>=1.2.0", "sphinx==5.1.1", "docutils==0.16"] + requires = ["sphinx_rtd_theme>=1.0.0", "sphinxcontrib.youtube>=1.2.0", "sphinx>=5.1.1", "docutils>=0.16"] for r in requires: debug("Checking for %s" % r) try: @@ -1085,7 +1092,7 @@ def create_features_page(features, build_options_by_define, vehicletype): put_cached_parameters_files_in_sites(args.site) cache_parameters_files(args.site) - check_build(args.site) + check_build(args.site, args.no_html, args.pdf) if args.enablebackups: make_backup(args.site, args.destdir, args.backupdestdir)