From 8d10454fa86b8f9c022cf2df5d896f17c15d69b8 Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 15:51:10 +0800 Subject: [PATCH 01/16] Update .readthedocs.yaml --- .readthedocs.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index eeb2719..349c868 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -13,3 +13,5 @@ sphinx: python: install: - requirements: requirements.txt + +formats: all From 85785ff9b3bdcff05b5f3ac22df284ceca80258e Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 15:57:27 +0800 Subject: [PATCH 02/16] Update requirements.txt --- requirements.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index c0fe792..12908e6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -Sphinx==6.2.1 -sphinx-rtd-theme==1.2.2 -sphinx-autobuild==2021年3月14日 -docutils==0.18.1 -readthedocs-sphinx-search==0.3.1 -Jinja2==3.1.2 +Sphinx +sphinx-rtd-theme +sphinx-autobuild +docutils +readthedocs-sphinx-search +Jinja2 From 4f6e14adb22d9933cc6f2b17cee99dd8d915c034 Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 16:01:54 +0800 Subject: [PATCH 03/16] Update conf.py --- conf.py | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/conf.py b/conf.py index 891ea0d..6ec9345 100755 --- a/conf.py +++ b/conf.py @@ -64,9 +64,36 @@ def _warn_node(self, msg, node, **kw): # nore README.rst exclude_patterns = ['README.rst'] -latex_documents = [ - ('documentation', 'manual', False), -] + + +# -- Options for LaTeX output --------------------------------------------- +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', +'preamble': r''' +\hypersetup{unicode=true} +\usepackage{CJKutf8} +\DeclareUnicodeCharacter{00A0}{\nobreakspace} +\DeclareUnicodeCharacter{2203}{\ensuremath{\exists}} +\DeclareUnicodeCharacter{2200}{\ensuremath{\forall}} +\DeclareUnicodeCharacter{2286}{\ensuremath{\subseteq}} +\DeclareUnicodeCharacter{2713}{x} +\DeclareUnicodeCharacter{27FA}{\ensuremath{\Longleftrightarrow}} +\DeclareUnicodeCharacter{221A}{\ensuremath{\sqrt{}}} +\DeclareUnicodeCharacter{221B}{\ensuremath{\sqrt[3]{}}} +\DeclareUnicodeCharacter{2295}{\ensuremath{\oplus}} +\DeclareUnicodeCharacter{2297}{\ensuremath{\otimes}} +\begin{CJK}{UTF8}{gbsn} +\AtEndDocument{\end{CJK}} +''', +} + # HACK: sphinx has limited support for substitutions with the |version| # variable, but there doesn't appear to be any way to use this in a link From b3e4368369c98610a8cdebb7f23007980f72d7ed Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 16:06:18 +0800 Subject: [PATCH 04/16] Update conf.py --- conf.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/conf.py b/conf.py index 6ec9345..16eda82 100755 --- a/conf.py +++ b/conf.py @@ -67,6 +67,7 @@ def _warn_node(self, msg, node, **kw): # -- Options for LaTeX output --------------------------------------------- +latex_engine = 'xelatex' latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', @@ -94,6 +95,15 @@ def _warn_node(self, msg, node, **kw): ''', } +latex_documents = [ + ( + master_doc, + "python-golang-web-guide.tex", + u"python-golang-web-guide Documentation", + u"pegasuswang", + "manual", + ) +] # HACK: sphinx has limited support for substitutions with the |version| # variable, but there doesn't appear to be any way to use this in a link From 76bc49bb7b6105a0c0ae401f0c9cd51bd2096521 Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 16:09:51 +0800 Subject: [PATCH 05/16] Update conf.py --- conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/conf.py b/conf.py index 16eda82..91dae4c 100755 --- a/conf.py +++ b/conf.py @@ -67,7 +67,6 @@ def _warn_node(self, msg, node, **kw): # -- Options for LaTeX output --------------------------------------------- -latex_engine = 'xelatex' latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', From eb835119022d775c6b750fb10ed269feab9927a2 Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 16:15:59 +0800 Subject: [PATCH 06/16] Update conf.py --- conf.py | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/conf.py b/conf.py index 91dae4c..a356bd4 100755 --- a/conf.py +++ b/conf.py @@ -67,33 +67,18 @@ def _warn_node(self, msg, node, **kw): # -- Options for LaTeX output --------------------------------------------- +latex_engine = 'xelatex' + latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', - -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', - -# Additional stuff for the LaTeX preamble. -#'preamble': '', -'preamble': r''' + 'preamble': r''' \hypersetup{unicode=true} \usepackage{CJKutf8} -\DeclareUnicodeCharacter{00A0}{\nobreakspace} -\DeclareUnicodeCharacter{2203}{\ensuremath{\exists}} -\DeclareUnicodeCharacter{2200}{\ensuremath{\forall}} -\DeclareUnicodeCharacter{2286}{\ensuremath{\subseteq}} -\DeclareUnicodeCharacter{2713}{x} -\DeclareUnicodeCharacter{27FA}{\ensuremath{\Longleftrightarrow}} -\DeclareUnicodeCharacter{221A}{\ensuremath{\sqrt{}}} -\DeclareUnicodeCharacter{221B}{\ensuremath{\sqrt[3]{}}} -\DeclareUnicodeCharacter{2295}{\ensuremath{\oplus}} -\DeclareUnicodeCharacter{2297}{\ensuremath{\otimes}} \begin{CJK}{UTF8}{gbsn} \AtEndDocument{\end{CJK}} ''', } + latex_documents = [ ( master_doc, From f0f7c3063b223fd60d0375c8099a879780661a7b Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 16:18:11 +0800 Subject: [PATCH 07/16] Update requirements.txt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 12908e6..53236b2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ sphinx-autobuild docutils readthedocs-sphinx-search Jinja2 +sphinxcontrib-svg2pdfconverter From 43969c4d0ecc7eb3ea3e98dab9cd66314c620b2f Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 16:19:25 +0800 Subject: [PATCH 08/16] Update conf.py --- conf.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/conf.py b/conf.py index a356bd4..01b8259 100755 --- a/conf.py +++ b/conf.py @@ -27,6 +27,7 @@ def _warn_node(self, msg, node, **kw): "sphinx.ext.extlinks", "sphinx.ext.intersphinx", "sphinx.ext.viewcode", + "sphinx.ext.imgconverter", ] primary_domain = 'py' @@ -71,14 +72,13 @@ def _warn_node(self, msg, node, **kw): latex_elements = { 'preamble': r''' -\hypersetup{unicode=true} -\usepackage{CJKutf8} -\begin{CJK}{UTF8}{gbsn} -\AtEndDocument{\end{CJK}} -''', +\usepackage{xeCJK} +\setCJKmainfont{Source Han Serif SC} +''' } + latex_documents = [ ( master_doc, From 612bab9cf7ca1e82bc9a36ed27a958ad1a0aabe4 Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 16:25:46 +0800 Subject: [PATCH 09/16] Update conf.py --- conf.py | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/conf.py b/conf.py index 01b8259..af3d799 100755 --- a/conf.py +++ b/conf.py @@ -67,26 +67,38 @@ def _warn_node(self, msg, node, **kw): -# -- Options for LaTeX output --------------------------------------------- -latex_engine = 'xelatex' +# -- Options for LaTeX output -------------------------------------------------- +# 强制使用 xelatex 支持中文 +latex_engine = 'xelatex' latex_elements = { +# 纸张、字号可按需调整 + 'papersize': 'a4paper', + 'pointsize': '11pt', + + # 最简 preamble,使用 xeCJK 支持中文 'preamble': r''' \usepackage{xeCJK} -\setCJKmainfont{Source Han Serif SC} +\setCJKmainfont{FandolSong-Regular} +\setCJKsansfont{FandolSong-Regular} +\setCJKmonofont{FandolSong-Regular} +\linespread{1.2} + +% 支持超链接 +\hypersetup{unicode=true} + +% 避免章节标题中文断行问题 +\renewcommand{\contentsname}{目录} +\renewcommand{\figurename}{图} +\renewcommand{\tablename}{表} ''' } latex_documents = [ - ( - master_doc, - "python-golang-web-guide.tex", - u"python-golang-web-guide Documentation", - u"pegasuswang", - "manual", - ) + ('index', 'python-web-guide.tex', u'Python Web Guide', + u'asisbai', 'manual'), ] # HACK: sphinx has limited support for substitutions with the |version| From ace9ee8f9923b81f85ee1e2b4c8c13e506e677c3 Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 16:26:37 +0800 Subject: [PATCH 10/16] Update .readthedocs.yaml --- .readthedocs.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 349c868..f819eb4 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,8 +3,21 @@ version: 2 build: os: "ubuntu-22.04" tools: - python: "3.10" - + python: "3.11" + apt_packages: + # xelatex 和常用宏包 + - texlive-xetex + - texlive-latex-extra + - texlive-fonts-recommended + - texlive-fonts-extra + - latexmk + # 中文字体(Fandol) + - fonts-fandol + # inkscape 用于转换 SVG → PDF + - inkscape + # ghostscript 用于处理 PDF 图像 + - ghostscript + # Build from the docs/ directory with Sphinx sphinx: configuration: conf.py From e3ff5ca1d6c0b9b4325c010537d2794662ae9c52 Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 16:27:54 +0800 Subject: [PATCH 11/16] Update .readthedocs.yaml --- .readthedocs.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index f819eb4..e360843 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -4,18 +4,14 @@ build: os: "ubuntu-22.04" tools: python: "3.11" - apt_packages: - # xelatex 和常用宏包 + apt_packages: - texlive-xetex - texlive-latex-extra - texlive-fonts-recommended - texlive-fonts-extra - latexmk - # 中文字体(Fandol) - fonts-fandol - # inkscape 用于转换 SVG → PDF - inkscape - # ghostscript 用于处理 PDF 图像 - ghostscript # Build from the docs/ directory with Sphinx From 8af826639432e1aecbcc3795e19609068a30ede6 Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 16:29:01 +0800 Subject: [PATCH 12/16] Update requirements.txt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 53236b2..2972d90 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ docutils readthedocs-sphinx-search Jinja2 sphinxcontrib-svg2pdfconverter +myst-parser From c09b8635540703b9892cd6e62af29a51ff954a1c Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 16:29:32 +0800 Subject: [PATCH 13/16] Update requirements.txt --- requirements.txt | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/requirements.txt b/requirements.txt index 2972d90..320faf2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,17 @@ -Sphinx -sphinx-rtd-theme -sphinx-autobuild -docutils -readthedocs-sphinx-search -Jinja2 -sphinxcontrib-svg2pdfconverter -myst-parser +# docs/requirements.txt +# 核心 Sphinx,必须小写,保证>= 7.0 +sphinx>=7.0.0 +# 主题 +sphinx-rtd-theme>=2.0.0 +# Markdown 解析 +myst-parser>=2.0.0 +# 自动刷新构建(本地用,RTD不会用到,但保留没问题) +sphinx-autobuild>=2021年3月14日 +# 保持 docutils 在兼容范围 +docutils>=0.17,<0.21 +# 搜索扩展 +readthedocs-sphinx-search>=0.3.2 +# 解析 Jinja2 模板 +Jinja2>=3.0 +# SVG 转 PDF +sphinxcontrib-svg2pdfconverter>=1.2.1 From 17f0241bd8b87e6988217f1305a1df358c7582f0 Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 16:30:36 +0800 Subject: [PATCH 14/16] Update .readthedocs.yaml --- .readthedocs.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index e360843..7dd7bb3 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -10,7 +10,6 @@ build: - texlive-fonts-recommended - texlive-fonts-extra - latexmk - - fonts-fandol - inkscape - ghostscript From 9896496b0d81f1305f0eb484a3a05144508d5520 Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 16:36:41 +0800 Subject: [PATCH 15/16] Update conf.py --- conf.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/conf.py b/conf.py index af3d799..aaacc8f 100755 --- a/conf.py +++ b/conf.py @@ -78,11 +78,12 @@ def _warn_node(self, msg, node, **kw): # 最简 preamble,使用 xeCJK 支持中文 'preamble': r''' -\usepackage{xeCJK} -\setCJKmainfont{FandolSong-Regular} -\setCJKsansfont{FandolSong-Regular} -\setCJKmonofont{FandolSong-Regular} -\linespread{1.2} +\usepackage{xeCJK} % 支持中文 +\setCJKmainfont{SimSun} % 中文主字体 +\setCJKsansfont{SimHei} % 中文无衬线字体 +\setCJKmonofont{FangSong} % 中文等宽字体 +''' +} % 支持超链接 \hypersetup{unicode=true} From 6e7301caccc662cc9fd586a97c0bd264fd03e7d8 Mon Sep 17 00:00:00 2001 From: asisbai <31835294+asisbai@users.noreply.github.com> Date: 2025年9月29日 16:40:41 +0800 Subject: [PATCH 16/16] Update conf.py --- conf.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/conf.py b/conf.py index aaacc8f..f140f7e 100755 --- a/conf.py +++ b/conf.py @@ -78,25 +78,13 @@ def _warn_node(self, msg, node, **kw): # 最简 preamble,使用 xeCJK 支持中文 'preamble': r''' -\usepackage{xeCJK} % 支持中文 -\setCJKmainfont{SimSun} % 中文主字体 -\setCJKsansfont{SimHei} % 中文无衬线字体 -\setCJKmonofont{FangSong} % 中文等宽字体 +\usepackage{xeCJK} +\setCJKmainfont{SimSun} +\setCJKsansfont{SimHei} +\setCJKmonofont{FangSong} ''' } -% 支持超链接 -\hypersetup{unicode=true} - -% 避免章节标题中文断行问题 -\renewcommand{\contentsname}{目录} -\renewcommand{\figurename}{图} -\renewcommand{\tablename}{表} -''' -} - - - latex_documents = [ ('index', 'python-web-guide.tex', u'Python Web Guide', u'asisbai', 'manual'),

AltStyle によって変換されたページ (->オリジナル) /