From 6ca3f0fda49b1827175076a7424c76ea94231eaf Mon Sep 17 00:00:00 2001 From: Tetsuo Koyama Date: Thu, 29 May 2025 05:01:07 +0900 Subject: [PATCH 01/10] Add `atsphinx-mini18n` to build i18n site --- .github/workflows/doc-build.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 7d8973c365..10a1daeb53 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -228,6 +228,19 @@ jobs: run: | xvfb-run make -C doc ${{ inputs.builder }} SPHINXOPTS="-j auto -W --keep-going" + - uses: actions/checkout@v4 + with: + repository: tkoyama010/pymapdl-doc-translations + path: pymapdl-doc-translations + fetch-depth: 0 + persist-credentials: false + + - name: Build I18N Documentation + run: | + xvfb-run make -C doc mini18n-html SPHINXOPTS="-j auto -W --keep-going" + find doc/_build/mini18n-html -mindepth 1 -maxdepth 1 -type d -exec cp -rf {} doc/_build/html/ \; + rm -rf doc/_build/mini18n-html + - name: "Substitute defective GIF" shell: bash run: | @@ -291,4 +304,4 @@ jobs: LOG_NAMES: logs-build-docs shell: bash run: | - .ci/display_logs_remote.sh \ No newline at end of file + .ci/display_logs_remote.sh From 3983d6de56f08fa92e2c68e6c4eb5d589eff4947 Mon Sep 17 00:00:00 2001 From: Tetsuo Koyama Date: Thu, 29 May 2025 05:11:25 +0900 Subject: [PATCH 02/10] Update conf.py --- doc/source/conf.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index e14000634e..0cba19f577 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,5 +1,6 @@ """Sphinx documentation configuration file.""" +from atsphinx.mini18n import get_template_dir from datetime import datetime import os from pathlib import Path @@ -108,6 +109,7 @@ "sphinx.ext.graphviz", "ansys_sphinx_theme.extension.linkcode", "sphinx.ext.mathjax", + 'atsphinx.mini18n', ] # Intersphinx mapping @@ -175,7 +177,7 @@ panels_add_fontawesome_latex = True # Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] +templates_path = ["_templates", get_template_dir()] # The suffix(es) of source filenames. source_suffix = ".rst" @@ -298,6 +300,10 @@ html_short_title = html_title = "PyMAPDL" html_theme = "ansys_sphinx_theme" html_theme_options = { + "navbar_start": [ + "navbar-logo", + "mini18n/snippets/select-lang", + ], "logo": "pyansys", "analytics": {"google_analytics_id": "G-JQJKPV6ZVB"}, "github_url": f"https://github.com/{USERNAME}/{REPOSITORY_NAME}", From e6940322428918e0615056be2abdce7991a43fd4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 20:11:46 +0000 Subject: [PATCH 03/10] ci: auto fixes from pre-commit.com hooks. for more information, see https://pre-commit.ci --- doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 0cba19f577..a275431a8c 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,6 +1,5 @@ """Sphinx documentation configuration file.""" -from atsphinx.mini18n import get_template_dir from datetime import datetime import os from pathlib import Path @@ -9,6 +8,7 @@ import ansys.tools.visualization_interface as viz_interface from ansys_sphinx_theme import ansys_favicon, get_version_match +from atsphinx.mini18n import get_template_dir import numpy as np import plotly.io as pio from plotly.io._sg_scraper import plotly_sg_scraper From 0c7d8ffdfea4ddfdad11625a9ed467c1158e0bbd Mon Sep 17 00:00:00 2001 From: Tetsuo Koyama Date: Thu, 29 May 2025 05:14:18 +0900 Subject: [PATCH 04/10] Update pyproject.toml --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 410de21ad8..7f4642d28c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,6 +86,7 @@ tests = [ ] doc = [ + 'atsphinx-mini18n==0.4.1', "ansys-dpf-core[graphics]==0.13.6", "ansys-mapdl-reader==0.55.1", "ansys-sphinx-theme==1.4.4", From 4b57ad5c90fec37eebf3d782249221156cc1baee Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 20:15:13 +0000 Subject: [PATCH 05/10] ci: auto fixes from pre-commit.com hooks. for more information, see https://pre-commit.ci --- doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index a275431a8c..df0563225c 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -109,7 +109,7 @@ "sphinx.ext.graphviz", "ansys_sphinx_theme.extension.linkcode", "sphinx.ext.mathjax", - 'atsphinx.mini18n', + "atsphinx.mini18n", ] # Intersphinx mapping From 6526b1eb00e4c23a0555269e3062fa448b674c1e Mon Sep 17 00:00:00 2001 From: Tetsuo Koyama Date: Thu, 29 May 2025 05:23:01 +0900 Subject: [PATCH 06/10] Update conf.py --- doc/source/conf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index df0563225c..f6187c775e 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -446,6 +446,10 @@ # A list of files that should not be packed into the epub file. epub_exclude_files = ["search.html"] +# -- atsphinx.mini18n options ------------------------------------------------- +mini18n_default_language = language +mini18n_support_languages = ['en', 'ja'] +locale_dirs = ['../../pymapdl-doc-translations/locale'] def setup(app: Sphinx): """Add custom configuration to sphinx app. From 97261eef6935f916a6c869e23a9c334466094996 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 20:25:16 +0000 Subject: [PATCH 07/10] ci: auto fixes from pre-commit.com hooks. for more information, see https://pre-commit.ci --- doc/source/conf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index f6187c775e..7528df2405 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -448,8 +448,9 @@ # -- atsphinx.mini18n options ------------------------------------------------- mini18n_default_language = language -mini18n_support_languages = ['en', 'ja'] -locale_dirs = ['../../pymapdl-doc-translations/locale'] +mini18n_support_languages = ["en", "ja"] +locale_dirs = ["../../pymapdl-doc-translations/locale"] + def setup(app: Sphinx): """Add custom configuration to sphinx app. From bc3417b55f4a62f11f60781e2aa429949c69e4f4 Mon Sep 17 00:00:00 2001 From: Tetsuo Koyama Date: Thu, 29 May 2025 05:37:39 +0900 Subject: [PATCH 08/10] Update pyproject.toml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7f4642d28c..9be2623d47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,7 +86,7 @@ tests = [ ] doc = [ - 'atsphinx-mini18n==0.4.1', + "atsphinx-mini18n==0.4.1", "ansys-dpf-core[graphics]==0.13.6", "ansys-mapdl-reader==0.55.1", "ansys-sphinx-theme==1.4.4", From e55fadef5a611ba3d9a04a893714e8a3d185f09d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 12:43:20 +0000 Subject: [PATCH 09/10] ci: auto fixes from pre-commit.com hooks. for more information, see https://pre-commit.ci --- pyproject.toml | 60 +++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 80243a4666..8e71617ed4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,37 +83,37 @@ tests = [ ] doc = [ + "ansys-dpf-core[graphics]==0.13.6", + "ansys-mapdl-reader==0.55.1", + "ansys-sphinx-theme==1.4.4", + "ansys-tools-visualization-interface==0.9.1", "atsphinx-mini18n==0.4.1", - "ansys-dpf-core[graphics]==0.13.6", - "ansys-mapdl-reader==0.55.1", - "ansys-sphinx-theme==1.4.4", - "ansys-tools-visualization-interface==0.9.1", - "grpcio==1.70.0", - "imageio-ffmpeg==0.6.0", - "imageio==2.37.0", - "jupyter_sphinx==0.5.3", - "jupyter==1.1.1", - "jupyterlab>=3.2.8", - "matplotlib==3.10.3", - "nbformat==5.10.4", - "numpydoc==1.8.0", - "pandas==2.2.3", - "plotly==6.1.1", - "pyiges[full]==0.3.1", - "pypandoc==1.15", - "pytest-sphinx==0.6.3", - "pythreejs==2.4.2", - "sphinx-autobuild==2024.10.3", - "sphinx-autodoc-typehints==3.1.0", - "sphinx-copybutton==0.5.2", - "sphinx-design==0.6.1", - "sphinx-gallery==0.19.0", - "sphinx-jinja==2.0.2", - "sphinx-notfound-page==1.1.0", - "sphinx==8.2.3", - "sphinxcontrib-websupport==2.0.0", - "sphinxemoji==0.3.1", - "vtk==9.4.2", + "grpcio==1.70.0", + "imageio-ffmpeg==0.6.0", + "imageio==2.37.0", + "jupyter==1.1.1", + "jupyter_sphinx==0.5.3", + "jupyterlab>=3.2.8", + "matplotlib==3.10.3", + "nbformat==5.10.4", + "numpydoc==1.8.0", + "pandas==2.2.3", + "plotly==6.1.1", + "pyiges[full]==0.3.1", + "pypandoc==1.15", + "pytest-sphinx==0.6.3", + "pythreejs==2.4.2", + "sphinx-autobuild==2024.10.3", + "sphinx-autodoc-typehints==3.1.0", + "sphinx-copybutton==0.5.2", + "sphinx-design==0.6.1", + "sphinx-gallery==0.19.0", + "sphinx-jinja==2.0.2", + "sphinx-notfound-page==1.1.0", + "sphinx==8.2.3", + "sphinxcontrib-websupport==2.0.0", + "sphinxemoji==0.3.1", + "vtk==9.4.2", ] [tool.flit.module] From dbaefff5df10869d7c35ae40e1907b012b2bb949 Mon Sep 17 00:00:00 2001 From: Tetsuo Koyama Date: Tue, 3 Jun 2025 07:22:19 +0900 Subject: [PATCH 10/10] Apply suggestions from code review --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8e71617ed4..d7a0a4a170 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,7 +85,7 @@ tests = [ doc = [ "ansys-dpf-core[graphics]==0.13.6", "ansys-mapdl-reader==0.55.1", - "ansys-sphinx-theme==1.4.4", + "ansys-sphinx-theme==1.5.0", "ansys-tools-visualization-interface==0.9.1", "atsphinx-mini18n==0.4.1", "grpcio==1.70.0", @@ -98,7 +98,7 @@ doc = [ "nbformat==5.10.4", "numpydoc==1.8.0", "pandas==2.2.3", - "plotly==6.1.1", + "plotly==6.1.2", "pyiges[full]==0.3.1", "pypandoc==1.15", "pytest-sphinx==0.6.3",