From 38afc2ac96c9d6b2c9eea62475ab92b7b8e88385 Mon Sep 17 00:00:00 2001 From: oujago Date: Tue, 7 Oct 2025 18:19:46 +0800 Subject: [PATCH 01/10] fix(docs): update documentation build script to reflect current versioning logic --- .readthedocs.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 08ccc9d7..37e13cb8 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -11,15 +11,17 @@ build: python: "3.13" jobs: post_checkout: - # Copy the appropriate conf.py based on project name + # Copy the appropriate conf.py based on git branch/tag - | - if [ "$DOC_BUILD_VERSION" = "v2" ]; then - echo "DOC_BUILD_VERSION is: $DOC_BUILD_VERSION" + CURRENT_VERSION="${READTHEDOCS_VERSION_NAME}" + echo "Building documentation for version: $CURRENT_VERSION" + + # Check if this is a v2 version (branch/tag starts with v2 or contains version2) + if [[ "$CURRENT_VERSION" == v2* ]] || [[ "$CURRENT_VERSION" == *version2* ]]; then echo "Building brainpy-version2 documentation" mkdir -p docs_build cp -r docs_version2/* docs_build/ else - echo "DOC_BUILD_VERSION is: $DOC_BUILD_VERSION" echo "Building standard brainpy documentation" mkdir -p docs_build cp -r docs/* docs_build/ From 9fa7a6ef317324c2b3605026c2a0a30e45c563e0 Mon Sep 17 00:00:00 2001 From: oujago Date: Tue, 7 Oct 2025 18:22:08 +0800 Subject: [PATCH 02/10] fix(docs): update version check in documentation build script to include stable versions --- .readthedocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 37e13cb8..aab77d20 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -17,7 +17,7 @@ build: echo "Building documentation for version: $CURRENT_VERSION" # Check if this is a v2 version (branch/tag starts with v2 or contains version2) - if [[ "$CURRENT_VERSION" == v2* ]] || [[ "$CURRENT_VERSION" == *version2* ]]; then + if [[ "$CURRENT_VERSION" == stable* ]] || [[ "$CURRENT_VERSION" == v2* ]] || [[ "$CURRENT_VERSION" == *version2* ]]; then echo "Building brainpy-version2 documentation" mkdir -p docs_build cp -r docs_version2/* docs_build/ From ab77e16ed5da013677ce2ec46a6f22992ece495c Mon Sep 17 00:00:00 2001 From: oujago Date: Tue, 7 Oct 2025 18:25:23 +0800 Subject: [PATCH 03/10] fix(docs): enhance version check in documentation build script to include 'latest' version --- .readthedocs.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index aab77d20..08a943c4 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -16,8 +16,8 @@ build: CURRENT_VERSION="${READTHEDOCS_VERSION_NAME}" echo "Building documentation for version: $CURRENT_VERSION" - # Check if this is a v2 version (branch/tag starts with v2 or contains version2) - if [[ "$CURRENT_VERSION" == stable* ]] || [[ "$CURRENT_VERSION" == v2* ]] || [[ "$CURRENT_VERSION" == *version2* ]]; then + # Check if this is a v2 version (latest, stable, or tags starting with v2) + if [[ "$CURRENT_VERSION" == "latest" ]] || [[ "$CURRENT_VERSION" == stable* ]] || [[ "$CURRENT_VERSION" == v2* ]] || [[ "$CURRENT_VERSION" == *version2* ]]; then echo "Building brainpy-version2 documentation" mkdir -p docs_build cp -r docs_version2/* docs_build/ @@ -29,7 +29,7 @@ build: # Build documentation using the copied conf.py sphinx: - configuration: docs_build/conf.py + configuration: docs_version2/conf.py # Optionally set the version of Python and requirements required to build your docs python: From 52883337a654b029dbc67a09ab9a74a04719b85c Mon Sep 17 00:00:00 2001 From: oujago Date: Tue, 7 Oct 2025 19:16:18 +0800 Subject: [PATCH 04/10] fix --- .readthedocs.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 08a943c4..f38ad806 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -13,11 +13,10 @@ build: post_checkout: # Copy the appropriate conf.py based on git branch/tag - | - CURRENT_VERSION="${READTHEDOCS_VERSION_NAME}" echo "Building documentation for version: $CURRENT_VERSION" # Check if this is a v2 version (latest, stable, or tags starting with v2) - if [[ "$CURRENT_VERSION" == "latest" ]] || [[ "$CURRENT_VERSION" == stable* ]] || [[ "$CURRENT_VERSION" == v2* ]] || [[ "$CURRENT_VERSION" == *version2* ]]; then + if [[ "$CURRENT_VERSION" == "v2" ]]; then echo "Building brainpy-version2 documentation" mkdir -p docs_build cp -r docs_version2/* docs_build/ From 4dc8da308b17a921a6050914e48a25e5e6d95fb9 Mon Sep 17 00:00:00 2001 From: oujago Date: Tue, 7 Oct 2025 19:16:35 +0800 Subject: [PATCH 05/10] fix --- .readthedocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index f38ad806..adb418d4 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -28,7 +28,7 @@ build: # Build documentation using the copied conf.py sphinx: - configuration: docs_version2/conf.py + configuration: docs_build/conf.py # Optionally set the version of Python and requirements required to build your docs python: From 0bb55fe36c00b6b5a2bb5ed0765f0ec2d556540a Mon Sep 17 00:00:00 2001 From: oujago Date: Tue, 7 Oct 2025 19:17:37 +0800 Subject: [PATCH 06/10] fix --- docs/conf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 2282061d..e6a4af73 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,6 +15,10 @@ import shutil import sys + +print(os.environ['CURRENT_VERSION']) + + sys.path.insert(0, os.path.abspath('./')) sys.path.insert(0, os.path.abspath('../')) sys.path.insert(0, r'D:\codes\projects\brainstate') From d6d72f2003c2839412ce85ee529984f94b5b8e39 Mon Sep 17 00:00:00 2001 From: oujago Date: Tue, 7 Oct 2025 19:28:03 +0800 Subject: [PATCH 07/10] fix --- .readthedocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index adb418d4..0d50a340 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -16,7 +16,7 @@ build: echo "Building documentation for version: $CURRENT_VERSION" # Check if this is a v2 version (latest, stable, or tags starting with v2) - if [[ "$CURRENT_VERSION" == "v2" ]]; then + if [ "$CURRENT_VERSION" == "v2" ]; then echo "Building brainpy-version2 documentation" mkdir -p docs_build cp -r docs_version2/* docs_build/ From c20f7af93b2ad10257888514035e06a681e4e8b3 Mon Sep 17 00:00:00 2001 From: oujago Date: Tue, 7 Oct 2025 19:41:06 +0800 Subject: [PATCH 08/10] fix(docs): update documentation build process for version 3 --- .gitignore | 3 + .readthedocs.yml | 18 +-- docs/conf.py | 38 +++-- docs_version2/Makefile | 21 --- docs_version2/conf.py | 150 ------------------ docs_version2/make.bat | 35 ---- {docs => docs_version3}/_static/css/theme.css | 0 .../_static/snn-simulation1.png | Bin .../_templates/classtemplate.rst | 0 {docs => docs_version3}/apis.rst | 0 .../checkpointing-en.ipynb | 0 .../checkpointing-zh.ipynb | 0 {docs => docs_version3}/index.rst | 0 .../snn_simulation-en.ipynb | 0 .../snn_simulation-zh.ipynb | 0 {docs => docs_version3}/snn_training-en.ipynb | 0 {docs => docs_version3}/snn_training-zh.ipynb | 0 .../spiking_neural_networks-en.ipynb | 0 .../spiking_neural_networks-zh.ipynb | 0 19 files changed, 32 insertions(+), 233 deletions(-) delete mode 100644 docs_version2/Makefile delete mode 100644 docs_version2/conf.py delete mode 100644 docs_version2/make.bat rename {docs => docs_version3}/_static/css/theme.css (100%) rename {docs => docs_version3}/_static/snn-simulation1.png (100%) rename {docs => docs_version3}/_templates/classtemplate.rst (100%) rename {docs => docs_version3}/apis.rst (100%) rename {docs => docs_version3}/checkpointing-en.ipynb (100%) rename {docs => docs_version3}/checkpointing-zh.ipynb (100%) rename {docs => docs_version3}/index.rst (100%) rename {docs => docs_version3}/snn_simulation-en.ipynb (100%) rename {docs => docs_version3}/snn_simulation-zh.ipynb (100%) rename {docs => docs_version3}/snn_training-en.ipynb (100%) rename {docs => docs_version3}/snn_training-zh.ipynb (100%) rename {docs => docs_version3}/spiking_neural_networks-en.ipynb (100%) rename {docs => docs_version3}/spiking_neural_networks-zh.ipynb (100%) diff --git a/.gitignore b/.gitignore index da6ec6fc..3ed5f76d 100644 --- a/.gitignore +++ b/.gitignore @@ -233,3 +233,6 @@ cython_debug/ /docs/_static/logos/ /docs/_build/ /docs/changelog.md +/docs_version3/_build/ +/docs_version3/_static/logos/ +/docs_version3/changelog.md diff --git a/.readthedocs.yml b/.readthedocs.yml index 0d50a340..90f394df 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -9,26 +9,10 @@ build: os: "ubuntu-24.04" tools: python: "3.13" - jobs: - post_checkout: - # Copy the appropriate conf.py based on git branch/tag - - | - echo "Building documentation for version: $CURRENT_VERSION" - - # Check if this is a v2 version (latest, stable, or tags starting with v2) - if [ "$CURRENT_VERSION" == "v2" ]; then - echo "Building brainpy-version2 documentation" - mkdir -p docs_build - cp -r docs_version2/* docs_build/ - else - echo "Building standard brainpy documentation" - mkdir -p docs_build - cp -r docs/* docs_build/ - fi # Build documentation using the copied conf.py sphinx: - configuration: docs_build/conf.py + configuration: docs/conf.py # Optionally set the version of Python and requirements required to build your docs python: diff --git a/docs/conf.py b/docs/conf.py index e6a4af73..5c5a656a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,20 +16,30 @@ import sys -print(os.environ['CURRENT_VERSION']) +build_version = os.environ.get('CURRENT_VERSION', 'v3') +if build_version == 'v2': + shutil.copytree( + os.path.join(os.path.dirname(__file__), '../docs_version2'), + os.path.join(os.path.dirname(__file__), ), + dirs_exist_ok=True + ) +else: + shutil.copytree( + os.path.join(os.path.dirname(__file__), '../docs_version3'), + os.path.join(os.path.dirname(__file__), ), + ) sys.path.insert(0, os.path.abspath('./')) sys.path.insert(0, os.path.abspath('../')) -sys.path.insert(0, r'D:\codes\projects\brainstate') import brainpy + shutil.copytree('../images/', './_static/logos/', dirs_exist_ok=True) shutil.copyfile('../changelog.md', './changelog.md') shutil.rmtree('./generated', ignore_errors=True) shutil.rmtree('./_build', ignore_errors=True) - # -- Project information ----------------------------------------------------- project = 'BrainPy' @@ -37,7 +47,6 @@ author = 'BrainPy Team' from highlight_test_lexer import fix_ipython2_lexer_in_notebooks - fix_ipython2_lexer_in_notebooks(os.path.dirname(os.path.abspath(__file__))) # The full version, including alpha/beta/rc tags @@ -92,12 +101,21 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # href with no underline and white bold text color -announcement = """ - - This site covers the new BrainPy 3.0 API. - [Click here for the classical BrainPy 2.0 API] - -""" + +if build_version == 'v2': + announcement = """ + + This site covers the new BrainPy 3.0 API. + [Click here for the classical BrainPy 2.0 API] + + """ +else: + announcement = """ + + This site covers the new BrainPy 3.0 API. + [Click here for the classical BrainPy 2.0 API] + + """ html_theme_options = { 'repository_url': 'https://github.com/brainpy/BrainPy', diff --git a/docs_version2/Makefile b/docs_version2/Makefile deleted file mode 100644 index 2de4207a..00000000 --- a/docs_version2/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SPHINXPROJ = brainpy -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs_version2/conf.py b/docs_version2/conf.py deleted file mode 100644 index c0b6339a..00000000 --- a/docs_version2/conf.py +++ /dev/null @@ -1,150 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# a_list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# - -import os -import shutil -import sys - -sys.path.insert(0, os.path.abspath('./')) -sys.path.insert(0, os.path.abspath('../')) - -import brainpy - -os.makedirs('apis/auto/', exist_ok=True) - -# import auto_generater -# auto_generater.generate_analysis_docs() -# auto_generater.generate_connect_docs() -# auto_generater.generate_encoding_docs() -# auto_generater.generate_initialize_docs() -# auto_generater.generate_inputs_docs() -# auto_generater.generate_dnn_docs() -# auto_generater.generate_dyn_docs() -# auto_generater.generate_losses_docs() -# auto_generater.generate_measure_docs() -# auto_generater.generate_optim_docs() -# auto_generater.generate_running_docs() -# auto_generater.generate_brainpy_docs() -# auto_generater.generate_integrators_doc() -# auto_generater.generate_math_docs() -# auto_generater.generate_mixin_docs() -# sys.exit() - -shutil.copytree('../images/', './_static/logos/', dirs_exist_ok=True) - -# -- Project information ----------------------------------------------------- - -project = 'BrainPy' -copyright = '2020-, BrainPy' -author = 'BrainPy Team' - -# The full version, including alpha/beta/rc tags -release = brainpy.__version__ - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.autosummary', - 'sphinx.ext.intersphinx', - 'sphinx.ext.mathjax', - 'sphinx.ext.napoleon', - 'sphinx.ext.viewcode', - 'sphinx_autodoc_typehints', - 'myst_nb', - 'matplotlib.sphinxext.plot_directive', - 'sphinx_thebe', - 'sphinx_design' - # 'sphinx-mathjax-offline', -] -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] -source_suffix = ['.rst', '.ipynb', '.md'] - -# source_suffix = '.rst' -autosummary_generate = True - -# The master toctree document. -master_doc = 'index' - -intersphinx_mapping = { - "python": ("https://docs.python.org/3.8", None), - "sphinx": ("https://www.sphinx-doc.org/en/master", None), -} -nitpick_ignore = [ - ("py:class", "docutils.nodes.document"), - ("py:class", "docutils.parsers.rst.directives.body.Sidebar"), -] - -suppress_warnings = ["myst.domains", "ref.ref"] -numfig = True -myst_enable_extensions = ["dollarmath", "amsmath", "deflist", "colon_fence"] -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] - -# href with no underline and white bold text color -announcement = """ - - This site covers the old BrainPy 2.0 API. [Explore the new BrainPy 3.0 API ✨] - -""" - -html_theme_options = { - 'repository_url': 'https://github.com/brainpy/BrainPy', - 'use_repository_button': True, # add a 'link to repository' button - 'use_issues_button': False, # add an 'Open an Issue' button - 'path_to_docs': 'docs', # used to compute the path to launch notebooks in colab - 'launch_buttons': { - 'colab_url': 'https://colab.research.google.com/', - }, - 'prev_next_buttons_location': None, - 'show_navbar_depth': 1, - 'announcement': announcement, - 'logo_only': True, - 'show_toc_level': 2, -} - -html_theme = "sphinx_book_theme" -html_logo = "_static/logos/logo.png" -html_title = "BrainPy documentation" -html_copy_source = True -html_sourcelink_suffix = "" -html_favicon = "_static/logos/logo-square.png" -html_last_updated_fmt = "" -html_css_files = ['css/theme.css'] - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] -jupyter_execute_notebooks = "off" -thebe_config = { - "repository_url": "https://github.com/binder-examples/jupyter-stacks-datascience", - "repository_branch": "master", -} - -# -- Options for myst ---------------------------------------------- -# Notebook cell execution timeout; defaults to 30. -execution_timeout = 200 - -autodoc_default_options = { - 'exclude-members': '....,default_rng', -} diff --git a/docs_version2/make.bat b/docs_version2/make.bat deleted file mode 100644 index 922152e9..00000000 --- a/docs_version2/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/_static/css/theme.css b/docs_version3/_static/css/theme.css similarity index 100% rename from docs/_static/css/theme.css rename to docs_version3/_static/css/theme.css diff --git a/docs/_static/snn-simulation1.png b/docs_version3/_static/snn-simulation1.png similarity index 100% rename from docs/_static/snn-simulation1.png rename to docs_version3/_static/snn-simulation1.png diff --git a/docs/_templates/classtemplate.rst b/docs_version3/_templates/classtemplate.rst similarity index 100% rename from docs/_templates/classtemplate.rst rename to docs_version3/_templates/classtemplate.rst diff --git a/docs/apis.rst b/docs_version3/apis.rst similarity index 100% rename from docs/apis.rst rename to docs_version3/apis.rst diff --git a/docs/checkpointing-en.ipynb b/docs_version3/checkpointing-en.ipynb similarity index 100% rename from docs/checkpointing-en.ipynb rename to docs_version3/checkpointing-en.ipynb diff --git a/docs/checkpointing-zh.ipynb b/docs_version3/checkpointing-zh.ipynb similarity index 100% rename from docs/checkpointing-zh.ipynb rename to docs_version3/checkpointing-zh.ipynb diff --git a/docs/index.rst b/docs_version3/index.rst similarity index 100% rename from docs/index.rst rename to docs_version3/index.rst diff --git a/docs/snn_simulation-en.ipynb b/docs_version3/snn_simulation-en.ipynb similarity index 100% rename from docs/snn_simulation-en.ipynb rename to docs_version3/snn_simulation-en.ipynb diff --git a/docs/snn_simulation-zh.ipynb b/docs_version3/snn_simulation-zh.ipynb similarity index 100% rename from docs/snn_simulation-zh.ipynb rename to docs_version3/snn_simulation-zh.ipynb diff --git a/docs/snn_training-en.ipynb b/docs_version3/snn_training-en.ipynb similarity index 100% rename from docs/snn_training-en.ipynb rename to docs_version3/snn_training-en.ipynb diff --git a/docs/snn_training-zh.ipynb b/docs_version3/snn_training-zh.ipynb similarity index 100% rename from docs/snn_training-zh.ipynb rename to docs_version3/snn_training-zh.ipynb diff --git a/docs/spiking_neural_networks-en.ipynb b/docs_version3/spiking_neural_networks-en.ipynb similarity index 100% rename from docs/spiking_neural_networks-en.ipynb rename to docs_version3/spiking_neural_networks-en.ipynb diff --git a/docs/spiking_neural_networks-zh.ipynb b/docs_version3/spiking_neural_networks-zh.ipynb similarity index 100% rename from docs/spiking_neural_networks-zh.ipynb rename to docs_version3/spiking_neural_networks-zh.ipynb From c7b37b59a16a0c80ed904df6e6d05cee658ef57f Mon Sep 17 00:00:00 2001 From: oujago Date: Tue, 7 Oct 2025 19:45:08 +0800 Subject: [PATCH 09/10] fix(conf): enhance cleanup process by adding file retention and error handling --- docs/conf.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 5c5a656a..85a1a7e2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,7 +15,20 @@ import shutil import sys - +# 要保留的文件/文件夹列表 +keep_files = {'highlight_test_lexer.py', 'conf.py', 'make.bat', 'Makefile'} + +# 遍历当前目录 +for item in os.listdir('.'): + if item not in keep_files: + path = os.path.join('.', item) + try: + if os.path.isfile(path): + os.remove(path) + elif os.path.isdir(path): + shutil.rmtree(path) + except Exception as e: + print(f"Error deleting {item}: {e}") build_version = os.environ.get('CURRENT_VERSION', 'v3') if build_version == 'v2': @@ -28,6 +41,7 @@ shutil.copytree( os.path.join(os.path.dirname(__file__), '../docs_version3'), os.path.join(os.path.dirname(__file__), ), + dirs_exist_ok=True ) sys.path.insert(0, os.path.abspath('./')) @@ -47,6 +61,7 @@ author = 'BrainPy Team' from highlight_test_lexer import fix_ipython2_lexer_in_notebooks + fix_ipython2_lexer_in_notebooks(os.path.dirname(os.path.abspath(__file__))) # The full version, including alpha/beta/rc tags From e916d7355a2c433b8cc96508a992e8b8ea46fbcf Mon Sep 17 00:00:00 2001 From: oujago Date: Tue, 7 Oct 2025 19:50:32 +0800 Subject: [PATCH 10/10] fix(conf): update links and cleanup process in configuration --- docs/conf.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 85a1a7e2..70a03338 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -51,8 +51,6 @@ shutil.copytree('../images/', './_static/logos/', dirs_exist_ok=True) shutil.copyfile('../changelog.md', './changelog.md') -shutil.rmtree('./generated', ignore_errors=True) -shutil.rmtree('./_build', ignore_errors=True) # -- Project information ----------------------------------------------------- @@ -119,9 +117,8 @@ if build_version == 'v2': announcement = """ - - This site covers the new BrainPy 3.0 API. - [Click here for the classical BrainPy 2.0 API] + + This site covers the old BrainPy 2.0 API. [Explore the new BrainPy 3.0 API ✨] """ else: