From 185333a0bd2a0906f95d16ade55ced6150b517ae Mon Sep 17 00:00:00 2001 From: WangWeimin Date: Sat, 20 Apr 2024 23:57:12 +0800 Subject: [PATCH] upgrade sphinx dependents --- .readthedocs.yml | 3 ++- docs/conf.py | 5 +++++ docs/static/pywebio.js | 4 ++-- requirements.txt | 11 ++++++----- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index e0de75f7..905a6cfa 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -20,7 +20,8 @@ sphinx: # configuration: mkdocs.yml # Optionally build your docs in additional formats such as PDF and ePub -formats: all +formats: + - pdf # 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 a79edbc8..6c8d8a5e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -37,6 +37,9 @@ 'sphinx_toolbox.collapse', ] +# https://github.com/sphinx-doc/sphinx/issues/6316 +toc_object_entries = False + primary_domain = "py" default_role = "py:obj" # intersphinx_mapping = {"python": ("https://docs.python.org/3.6/", None)} @@ -74,6 +77,8 @@ def setup(app): """Configure Sphinx""" app.add_css_file('pywebio.css') + # from docutils.parsers.rst.directives.admonitions import Note + # app.add_directive('collapse', Note) # -- Extension configuration ------------------------------------------------- diff --git a/docs/static/pywebio.js b/docs/static/pywebio.js index 4f67e770..3fa83068 100644 --- a/docs/static/pywebio.js +++ b/docs/static/pywebio.js @@ -35,11 +35,11 @@ ready(function () { // Translated Version Prompt const user_lang = (navigator.language || navigator.userLanguage || 'en').toLowerCase().split('-')[0]; -const doc_lang = window.location.pathname.split('/')[1].split('_')[0]; +const doc_lang = window.location.pathname.split('/')[1].split('-')[0]; if (user_lang !== doc_lang && ['zh', 'en'].indexOf(user_lang) !== -1) { let u = new URL(window.location.href); let t = u.pathname.split('/'); - t[1] = user_lang === 'en' ? 'en' : 'zh_CN'; + t[1] = user_lang === 'en' ? 'en' : 'zh-cn'; u.pathname = t.join('/'); let turl = u.href; diff --git a/requirements.txt b/requirements.txt index a24b29cd..63ab546d 100755 --- a/requirements.txt +++ b/requirements.txt @@ -21,13 +21,14 @@ percy-selenium coverage # doc building requirements -Jinja2==3.0.3 -sphinx==3.* +Jinja2 +sphinx sphinx-tabs -sphinx-rtd-theme==0.4.* -sphinx-toolbox==2.15.0 +sphinx-rtd-theme +sphinx-toolbox sphinx-intl -pywebio_battery +# pywebio_battery in master branch +https://github.com/pywebio/pywebio-battery/archive/refs/heads/master.zip # demo running requirements numpy