From 1b8cf825dd8ac96829d6a164d57c2c7aedeb3bf2 Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Fri, 23 Aug 2024 01:43:46 -0700 Subject: [PATCH 1/9] build autobuild all languages --- conf.py | 7 +++++++ noxfile.py | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/conf.py b/conf.py index 7b6d5a52..db3dc27f 100644 --- a/conf.py +++ b/conf.py @@ -26,6 +26,11 @@ copyright = f"{current_year}, {organization_name}" author = "pyOpenSci Community" +language = "en" +languages = ["es", "jp"] +# languages excluding english +# (english is built without a subdirectory to not break already-existing inbound links) + # Get the latest Git tag - there might be a prettier way to do this but... try: release_value = ( @@ -117,6 +122,8 @@ "github_user": "pyopensci", "github_repo": "python-package-guide", "github_version": "main", + 'language': language, + 'languages': languages } # Add any paths that contain templates here, relative to this directory. diff --git a/noxfile.py b/noxfile.py index 72138ac4..201094c3 100644 --- a/noxfile.py +++ b/noxfile.py @@ -2,6 +2,12 @@ import pathlib import shutil import nox +import sys +import subprocess + +# for some reason necessary to correctly import conf from cwd +sys.path.insert(0, str(pathlib.Path(__file__).parent.absolute())) +import conf nox.options.reuse_existing_virtualenvs = True @@ -43,7 +49,7 @@ ## Localization options (translations) # List of languages for which locales will be generated in (/locales/) -LANGUAGES = ["es", "ja"] +LANGUAGES = conf.languages # List of languages that should be built when releasing the guide (docs or docs-test sessions) RELEASE_LANGUAGES = [] @@ -71,6 +77,12 @@ def docs_test(session): # with those same parameters. session.notify("build-translations", ['release-build', *TEST_PARAMETERS]) +def _autobuild_cmd(posargs: list[str], output_dir = OUTPUT_DIR) -> list[str]: + cmd = [SPHINX_AUTO_BUILD, *BUILD_PARAMETERS, str(SOURCE_DIR), str(output_dir), *posargs] + for folder in AUTOBUILD_IGNORE: + cmd.extend(["--ignore", f"*/{folder}/*"]) + return cmd + @nox.session(name="docs-live") def docs_live(session): @@ -88,9 +100,7 @@ def docs_live(session): so they don't need to remember the specific sphinx-build parameters to build a different language. """ session.install("-e", ".") - cmd = [SPHINX_AUTO_BUILD, *BUILD_PARAMETERS, SOURCE_DIR, OUTPUT_DIR, *session.posargs] - for folder in AUTOBUILD_IGNORE: - cmd.extend(["--ignore", f"*/{folder}/*"]) + cmd = _autobuild_cmd(session.posargs) # This part was commented in the previous version of the nox file, keeping the same here # for folder in AUTOBUILD_INCLUDE: # cmd.extend(["--watch", folder]) @@ -128,6 +138,36 @@ def docs_live_lang(session): f"where LANG is one of: {LANGUAGES}" ) +@nox.session(name="docs-live-langs") +def docs_live_langs(session): + """ + Like docs-live but build all languages simultaneously + + Requires concurrently to run (npm install -g concurrently) + """ + try: + subprocess.check_call(['concurrently'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + except subprocess.CalledProcessError: + # handle errors in the called executable + # (aka, was found) + pass + except OSError: + session.error('docs-live-langs requires concurrently (npm install -g concurrently)') + + session.install("-e", ".") + + cmds = ['"' + " ".join(_autobuild_cmd(session.posargs) + ['--open-browser']) + '"'] + for language in LANGUAGES: + cmds.append( + '"' + " ".join( + _autobuild_cmd( + session.posargs + ["-D", f"language={language}"], + output_dir=OUTPUT_DIR / language + ) + ["--port=0"] + ) + '"' + ) + cmd = ['concurrently', '--kill-others', '-n', ','.join(['en'] + LANGUAGES), '-c', 'auto', *cmds] + session.run(*cmd) @nox.session(name="docs-clean") def clean_dir(session): From e0ae1fe39e2adde3a489b187c0475d413e5b49c2 Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Fri, 23 Aug 2024 03:39:15 -0700 Subject: [PATCH 2/9] language selector draft :) --- _static/language_select.js | 13 +++++++++++++ _static/pyos.css | 8 ++++++++ _templates/language-selector.html | 30 ++++++++++++++++++++++++++++++ conf.py | 25 ++++++++++++++++--------- noxfile.py | 13 ++++++++++--- 5 files changed, 77 insertions(+), 12 deletions(-) create mode 100644 _static/language_select.js create mode 100644 _templates/language-selector.html diff --git a/_static/language_select.js b/_static/language_select.js new file mode 100644 index 00000000..e1cae4c6 --- /dev/null +++ b/_static/language_select.js @@ -0,0 +1,13 @@ +document.addEventListener("DOMContentLoaded", () => { + let selectors = document.querySelectorAll("#language-selector"); + selectors.forEach((selector) => { + selector.addEventListener("change", (event) => { + let target = event.target.value; + if (target.startsWith("https")) { + window.location.href = target; + } else { + window.location.pathname = target; + } + }); + }); +}); diff --git a/_static/pyos.css b/_static/pyos.css index 52ff4bdb..5d166b55 100644 --- a/_static/pyos.css +++ b/_static/pyos.css @@ -46,6 +46,10 @@ body { margin-right: auto !important; } +.navbar-persistent--mobile { + margin-left: unset !important; +} + /* custom fonts */ html, @@ -375,3 +379,7 @@ th { border: 1px solid #ccc; /* Light gray border */ padding: 8px; /* Add some padding for better readability */ } + +/* ----------------- */ +/* Language Selector */ +/* ----------------- */ diff --git a/_templates/language-selector.html b/_templates/language-selector.html new file mode 100644 index 00000000..02d03742 --- /dev/null +++ b/_templates/language-selector.html @@ -0,0 +1,30 @@ +{%- macro langlink(lang, selected=False) -%} {%- if lang == "en" %} + +{%- else %} + +{%- endif -%} {%- endmacro -%} + diff --git a/conf.py b/conf.py index db3dc27f..260e0ee6 100644 --- a/conf.py +++ b/conf.py @@ -15,6 +15,7 @@ # sys.path.insert(0, os.path.abspath('.')) from datetime import datetime import subprocess +import os current_year = datetime.now().year organization_name = "pyOpenSci" @@ -26,10 +27,10 @@ copyright = f"{current_year}, {organization_name}" author = "pyOpenSci Community" -language = "en" -languages = ["es", "jp"] -# languages excluding english -# (english is built without a subdirectory to not break already-existing inbound links) +# language can later be overridden (eg with the -D flag) +# but we need it set here so it can make it into the html_context +language = os.environ.get("SPHINX_LANG", "en") +languages = ["en", "es", "jp"] # Get the latest Git tag - there might be a prettier way to do this but... try: @@ -76,7 +77,11 @@ {"href": "https://www.pyopensci.org/images/favicon.ico"}, ] -# Link to our repo for easy PR/ editing +html_baseurl = "https://www.pyopensci.org/python-package-guide/" +if os.environ.get("SPHINX_DEV", False): + # for links in language selector when developing locally + html_baseurl = "/" + html_theme_options = { "announcement": "

We run peer review of scientific Python software. Learn more.

", # "navbar_center": ["nav"], this can be a way to override the default navigation structure @@ -116,14 +121,16 @@ "github_url": "https://github.com/pyopensci/python-package-guide", "footer_start": ["code_of_conduct", "copyright"], "footer_end": [], + "navbar_persistent": ["language-selector", "search-button"] } html_context = { "github_user": "pyopensci", "github_repo": "python-package-guide", "github_version": "main", - 'language': language, - 'languages': languages + "language": language, + "languages": languages, + "base_url": html_baseurl, } # Add any paths that contain templates here, relative to this directory. @@ -147,7 +154,7 @@ ] # For sitemap generation -html_baseurl = "https://www.pyopensci.org/python-package-guide/" + sitemap_url_scheme = "{link}" # -- Options for HTML output ------------------------------------------------- @@ -159,7 +166,7 @@ html_static_path = ["_static"] html_css_files = ["pyos.css"] html_title = "Python Packaging Guide" -html_js_files = ["matomo.js"] +html_js_files = ["matomo.js", "language_select.js"] # Social cards diff --git a/noxfile.py b/noxfile.py index 201094c3..c0b75749 100644 --- a/noxfile.py +++ b/noxfile.py @@ -52,7 +52,7 @@ LANGUAGES = conf.languages # List of languages that should be built when releasing the guide (docs or docs-test sessions) -RELEASE_LANGUAGES = [] +RELEASE_LANGUAGES = [lang for lang in conf.languages if lang != "en"] @nox.session @@ -78,7 +78,7 @@ def docs_test(session): session.notify("build-translations", ['release-build', *TEST_PARAMETERS]) def _autobuild_cmd(posargs: list[str], output_dir = OUTPUT_DIR) -> list[str]: - cmd = [SPHINX_AUTO_BUILD, *BUILD_PARAMETERS, str(SOURCE_DIR), str(output_dir), *posargs] + cmd = ["SPHINX_DEV=true", SPHINX_AUTO_BUILD, *BUILD_PARAMETERS, str(SOURCE_DIR), str(output_dir), *posargs] for folder in AUTOBUILD_IGNORE: cmd.extend(["--ignore", f"*/{folder}/*"]) return cmd @@ -158,8 +158,11 @@ def docs_live_langs(session): cmds = ['"' + " ".join(_autobuild_cmd(session.posargs) + ['--open-browser']) + '"'] for language in LANGUAGES: + if language == "en": + continue cmds.append( '"' + " ".join( + [f"SPHINX_LANG={language}"] + _autobuild_cmd( session.posargs + ["-D", f"language={language}"], output_dir=OUTPUT_DIR / language @@ -217,7 +220,11 @@ def build_languages(session): session.warn(f"Language [{lang}] is not available for translation") continue session.log(f"Building [{lang}] guide") - session.run(SPHINX_BUILD, *BUILD_PARAMETERS, "-D", f"language={lang}", ".", OUTPUT_DIR / lang, *session.posargs) + if lang == 'en': + out_dir = OUTPUT_DIR + else: + out_dir = OUTPUT_DIR / lang + session.run(f"SPHINX_LANG={lang}", SPHINX_BUILD, *BUILD_PARAMETERS, "-D", f"language={lang}", ".", out_dir, *session.posargs) @nox.session(name="build-translations") From 488c43e542b5ccd362482ec40580ce7da9e57e1e Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Fri, 23 Aug 2024 03:56:01 -0700 Subject: [PATCH 3/9] pass env vars correctly --- noxfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index c0b75749..d92180df 100644 --- a/noxfile.py +++ b/noxfile.py @@ -169,7 +169,7 @@ def docs_live_langs(session): ) + ["--port=0"] ) + '"' ) - cmd = ['concurrently', '--kill-others', '-n', ','.join(['en'] + LANGUAGES), '-c', 'auto', *cmds] + cmd = ['concurrently', '--kill-others', '-n', ','.join(LANGUAGES), '-c', 'auto', *cmds] session.run(*cmd) @nox.session(name="docs-clean") @@ -224,7 +224,7 @@ def build_languages(session): out_dir = OUTPUT_DIR else: out_dir = OUTPUT_DIR / lang - session.run(f"SPHINX_LANG={lang}", SPHINX_BUILD, *BUILD_PARAMETERS, "-D", f"language={lang}", ".", out_dir, *session.posargs) + session.run(SPHINX_BUILD, *BUILD_PARAMETERS, "-D", f"language={lang}", ".", out_dir, *session.posargs, env={"SPHINX_LANG", lang}) @nox.session(name="build-translations") From 76f9af01c76eb1b2cb7c044bf5a04ba0df1ec534 Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Fri, 23 Aug 2024 04:00:31 -0700 Subject: [PATCH 4/9] how about i try testing it locally before i push --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index d92180df..0f58701d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -224,7 +224,7 @@ def build_languages(session): out_dir = OUTPUT_DIR else: out_dir = OUTPUT_DIR / lang - session.run(SPHINX_BUILD, *BUILD_PARAMETERS, "-D", f"language={lang}", ".", out_dir, *session.posargs, env={"SPHINX_LANG", lang}) + session.run(SPHINX_BUILD, *BUILD_PARAMETERS, "-D", f"language={lang}", ".", out_dir, *session.posargs, env={"SPHINX_LANG": lang}) @nox.session(name="build-translations") From b19a07a8912c6f83706f055785b7b4574160b138 Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Fri, 23 Aug 2024 20:43:43 -0700 Subject: [PATCH 5/9] unify dev/prod switching into SPHINX_ENV, fix jp -> ja language name, separate build_languages from languages in conf.py --- README.md | 22 ++++++++++++++++++++++ conf.py | 27 ++++++++++++++++++++++----- noxfile.py | 53 ++++++++++++++++++++++++++++++++++------------------- 3 files changed, 78 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 0b04e3ed..614ac6bd 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,28 @@ To build live documentation that updates when you update local files, run the fo $ nox -s docs-live ``` +### Building for release + +When building for release, the docs are built multiple times for each translation, +but translations are only included in the production version of the guide after some completion threshold. + +The sphinx build environment is controlled by an environment variable `SPHINX_ENV` + +- when `SPHINX_ENV=development` (default), sphinx assumes all languages are built, + and includes them in the language selector +- when `SPHINX_ENV=production`, only those languages in `release_languages` (set in `conf.py`) + are built and included in the language selector. + +Most of the time you should not need to set `SPHINX_ENV`, +as it is forced by the primary nox sessions intended to be used for release or development: + +`SPHINX_ENV=development` +- `docs-live` - autobuild english +- `docs-live-lang` - autobuild a single language +- `docs-live-langs` - autobuild all languages + +`SPHINX_ENV=production` +- `build-test` - build all languages for production ## Contributing to this guide diff --git a/conf.py b/conf.py index 260e0ee6..82293415 100644 --- a/conf.py +++ b/conf.py @@ -20,6 +20,10 @@ current_year = datetime.now().year organization_name = "pyOpenSci" +# env vars +sphinx_env = os.environ.get("SPHINX_ENV", "development") +language_env = os.environ.get("SPHINX_LANG", "en") + # -- Project information ----------------------------------------------------- @@ -27,10 +31,23 @@ copyright = f"{current_year}, {organization_name}" author = "pyOpenSci Community" +# Language of the current build # language can later be overridden (eg with the -D flag) # but we need it set here so it can make it into the html_context -language = os.environ.get("SPHINX_LANG", "en") -languages = ["en", "es", "jp"] +language = language_env +# all languages that have .po files generated for them +# (excluding english) +languages = ["es", "ja"] +# the languages that will be included in a production build +# (also excluding english) +release_languages = [] + +# languages that will be included in the language dropdown +# (ie. all that are being built in this nox build session) +if sphinx_env == "production": + build_languages = ["en"] + release_languages +else: + build_languages = ["en"] + languages # Get the latest Git tag - there might be a prettier way to do this but... try: @@ -78,7 +95,7 @@ ] html_baseurl = "https://www.pyopensci.org/python-package-guide/" -if os.environ.get("SPHINX_DEV", False): +if not sphinx_env == "production": # for links in language selector when developing locally html_baseurl = "/" @@ -129,8 +146,8 @@ "github_repo": "python-package-guide", "github_version": "main", "language": language, - "languages": languages, - "base_url": html_baseurl, + "languages": build_languages, + "baseurl": html_baseurl, } # Add any paths that contain templates here, relative to this directory. diff --git a/noxfile.py b/noxfile.py index 0f58701d..d6714224 100644 --- a/noxfile.py +++ b/noxfile.py @@ -52,16 +52,19 @@ LANGUAGES = conf.languages # List of languages that should be built when releasing the guide (docs or docs-test sessions) -RELEASE_LANGUAGES = [lang for lang in conf.languages if lang != "en"] +RELEASE_LANGUAGES = conf.release_languages +# allowable values of `SPHINX_ENV` +SPHINX_ENVS = ('production', 'development') @nox.session def docs(session): """Build the packaging guide.""" session.install("-e", ".") + sphinx_env = _sphinx_env(session) session.run(SPHINX_BUILD, *BUILD_PARAMETERS, SOURCE_DIR, OUTPUT_DIR, *session.posargs) # When building the guide, also build the translations in RELEASE_LANGUAGES - session.notify("build-translations", ['release-build']) + session.notify("build-translations", [sphinx_env]) @nox.session(name="docs-test") @@ -72,13 +75,14 @@ def docs_test(session): Note: this is the session used in CI/CD to release the guide. """ session.install("-e", ".") - session.run(SPHINX_BUILD, *BUILD_PARAMETERS, *TEST_PARAMETERS, SOURCE_DIR, OUTPUT_DIR, *session.posargs) + session.run(SPHINX_BUILD, *BUILD_PARAMETERS, *TEST_PARAMETERS, SOURCE_DIR, OUTPUT_DIR, *session.posargs, + env={'SPHINX_ENV': 'production'}) # When building the guide with additional parameters, also build the translations in RELEASE_LANGUAGES # with those same parameters. - session.notify("build-translations", ['release-build', *TEST_PARAMETERS]) + session.notify("build-translations", ['production', *TEST_PARAMETERS]) def _autobuild_cmd(posargs: list[str], output_dir = OUTPUT_DIR) -> list[str]: - cmd = ["SPHINX_DEV=true", SPHINX_AUTO_BUILD, *BUILD_PARAMETERS, str(SOURCE_DIR), str(output_dir), *posargs] + cmd = [SPHINX_AUTO_BUILD, *BUILD_PARAMETERS, str(SOURCE_DIR), str(output_dir), *posargs] for folder in AUTOBUILD_IGNORE: cmd.extend(["--ignore", f"*/{folder}/*"]) return cmd @@ -104,7 +108,7 @@ def docs_live(session): # This part was commented in the previous version of the nox file, keeping the same here # for folder in AUTOBUILD_INCLUDE: # cmd.extend(["--watch", folder]) - session.run(*cmd) + session.run(*cmd, env={'SPHINX_ENV': "development"}) @nox.session(name="docs-live-lang") @@ -156,20 +160,18 @@ def docs_live_langs(session): session.install("-e", ".") - cmds = ['"' + " ".join(_autobuild_cmd(session.posargs) + ['--open-browser']) + '"'] + cmds = ['"' + " ".join(["SPHINX_ENV=development"] + _autobuild_cmd(session.posargs) + ['--open-browser']) + '"'] for language in LANGUAGES: - if language == "en": - continue cmds.append( '"' + " ".join( - [f"SPHINX_LANG={language}"] + + [f"SPHINX_LANG={language}", "SPHINX_ENV=development"] + _autobuild_cmd( session.posargs + ["-D", f"language={language}"], output_dir=OUTPUT_DIR / language ) + ["--port=0"] ) + '"' ) - cmd = ['concurrently', '--kill-others', '-n', ','.join(LANGUAGES), '-c', 'auto', *cmds] + cmd = ['concurrently', '--kill-others', '-n', ','.join(["en"] + LANGUAGES), '-c', 'auto', *cmds] session.run(*cmd) @nox.session(name="docs-clean") @@ -212,6 +214,9 @@ def build_languages(session): """ if not session.posargs: session.error("Please provide the list of languages to build the translation for") + + sphinx_env = _sphinx_env(session) + languages_to_build = session.posargs.pop(0) session.install("-e", ".") @@ -224,7 +229,8 @@ def build_languages(session): out_dir = OUTPUT_DIR else: out_dir = OUTPUT_DIR / lang - session.run(SPHINX_BUILD, *BUILD_PARAMETERS, "-D", f"language={lang}", ".", out_dir, *session.posargs, env={"SPHINX_LANG": lang}) + session.run(SPHINX_BUILD, *BUILD_PARAMETERS, "-D", f"language={lang}", ".", out_dir, *session.posargs, + env={"SPHINX_LANG": lang, "SPHINX_ENV": sphinx_env}) @nox.session(name="build-translations") @@ -236,21 +242,19 @@ def build_translations(session): It is also called by the docs and docs-test sessions with 'release-build' as the first positional argument, to build only the translations defined in RELEASE_LANGUAGES. """ - release_build = False - if session.posargs and session.posargs[0] == 'release-build': - session.posargs.pop(0) - release_build = True + sphinx_env = _sphinx_env(session) + # if running from the docs or docs-test sessions, build only release languages - BUILD_LANGUAGES = RELEASE_LANGUAGES if release_build else LANGUAGES + BUILD_LANGUAGES = RELEASE_LANGUAGES if sphinx_env == "production" else LANGUAGES # only build languages that have a locale folder BUILD_LANGUAGES = [lang for lang in BUILD_LANGUAGES if (TRANSLATION_LOCALES_DIR / lang).exists()] session.log(f"Declared languages: {LANGUAGES}") session.log(f"Release languages: {RELEASE_LANGUAGES}") - session.log(f"Building languages{' for release' if release_build else ''}: {BUILD_LANGUAGES}") + session.log(f"Building languages{' for release' if sphinx_env == 'production' else ''}: {BUILD_LANGUAGES}") if not BUILD_LANGUAGES: session.warn("No translations to build") else: - session.notify("build-languages", [BUILD_LANGUAGES, *session.posargs]) + session.notify("build-languages", [sphinx_env, BUILD_LANGUAGES, *session.posargs]) @nox.session(name="build-translations-test") @@ -262,3 +266,14 @@ def build_translations_test(session): in the same way docs-test does for the English version. """ session.notify("build-translations", [*TEST_PARAMETERS]) + + +def _sphinx_env(session) -> str: + """ + Get the sphinx env, from the first positional argument if present or from the + ``SPHINX_ENV`` environment variable, defaulting to "development" + """ + if session.posargs and session.posargs[0] in SPHINX_ENVS: + return session.posargs.pop(0) + else: + return os.environ.get('SPHINX_ENV', 'development') From 7e7fd1ecc1fc6bcd1561f6974ea9aabbd1c12c6d Mon Sep 17 00:00:00 2001 From: Tetsuo Koyama Date: Wed, 23 Apr 2025 21:35:29 +0900 Subject: [PATCH 6/9] Update noxfile.py --- noxfile.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/noxfile.py b/noxfile.py index 7e5a3c4d..86319a08 100644 --- a/noxfile.py +++ b/noxfile.py @@ -64,7 +64,6 @@ def docs(session): session.run(SPHINX_BUILD, *BUILD_PARAMETERS, SOURCE_DIR, OUTPUT_DIR, *session.posargs) # When building the guide, also build the translations in RELEASE_LANGUAGES session.notify("build-release-languages", session.posargs) - session.notify("build-translations", [sphinx_env]) @nox.session(name="docs-test") @@ -80,7 +79,6 @@ def docs_test(session): # When building the guide with additional parameters, also build the translations in RELEASE_LANGUAGES # with those same parameters. session.notify("build-release-languages", [*TEST_PARAMETERS, *session.posargs]) - session.notify("build-translations", ['production', *TEST_PARAMETERS]) def _autobuild_cmd(posargs: list[str], output_dir = OUTPUT_DIR) -> list[str]: cmd = [SPHINX_AUTO_BUILD, *BUILD_PARAMETERS, str(SOURCE_DIR), str(output_dir), *posargs] @@ -321,7 +319,6 @@ def build_all_languages_test(session): in the same way docs-test does for the English version. """ session.notify("build-all-languages", [*TEST_PARAMETERS]) - session.notify("build-translations", [*TEST_PARAMETERS]) def _sphinx_env(session) -> str: From 957460bd265fe00545fd179e0a90308112a7767b Mon Sep 17 00:00:00 2001 From: Tetsuo Koyama Date: Wed, 23 Apr 2025 21:47:46 +0900 Subject: [PATCH 7/9] Update conf.py --- conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 13f0e75c..49c3ec4e 100644 --- a/conf.py +++ b/conf.py @@ -40,7 +40,7 @@ languages = ["es", "ja"] # the languages that will be included in a production build # (also excluding english) -release_languages = [] +release_languages = ["ja"] # languages that will be included in the language dropdown # (ie. all that are being built in this nox build session) From 7ab8ec2ce38596380f6c601c1d790c93ffbe9a43 Mon Sep 17 00:00:00 2001 From: Tetsuo Koyama Date: Wed, 23 Apr 2025 21:55:12 +0900 Subject: [PATCH 8/9] Update noxfile.py --- noxfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/noxfile.py b/noxfile.py index 86319a08..2ffce94e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -267,6 +267,7 @@ def build_release_languages(session): """ Build the translations of the guide for the languages in RELEASE_LANGUAGES. """ + sphinx_env = _sphinx_env(session) if not RELEASE_LANGUAGES: session.warn("No release languages defined in RELEASE_LANGUAGES") return From c1d3acff22bddada6ef0b28c09aa56f99d66b940 Mon Sep 17 00:00:00 2001 From: Tetsuo Koyama Date: Wed, 23 Apr 2025 22:02:14 +0900 Subject: [PATCH 9/9] Update noxfile.py --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 2ffce94e..fe70c482 100644 --- a/noxfile.py +++ b/noxfile.py @@ -29,7 +29,7 @@ BUILD_PARAMETERS = ["-b", "html"] # Sphinx parameters used to test the build of the guide -TEST_PARAMETERS = ['-W', '--keep-going', '-E', '-a'] +TEST_PARAMETERS = ['--keep-going', '-E', '-a'] # Sphinx parameters to generate translation templates TRANSLATION_TEMPLATE_PARAMETERS = ["-b", "gettext"]