Jelajahi Sumber

upgrade sphinx dependents

WangWeimin 1 tahun lalu
induk
melakukan
185333a0bd
4 mengubah file dengan 15 tambahan dan 8 penghapusan
  1. 2 1
      .readthedocs.yml
  2. 5 0
      docs/conf.py
  3. 2 2
      docs/static/pywebio.js
  4. 6 5
      requirements.txt

+ 2 - 1
.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:

+ 5 - 0
docs/conf.py

@@ -37,6 +37,9 @@ extensions = [
     '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 @@ html_static_path = ['static']
 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 -------------------------------------------------

+ 2 - 2
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;

+ 6 - 5
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