File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ def setup(app):
3030# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
3131
3232html_theme = 'sphinx_rtd_theme'
33+ html_static_path = ['_static' ]
3334
3435html_theme_options = {
3536 'display_version' : True ,
@@ -50,4 +51,14 @@ def setup(app):
5051 'js/include_html.js' # 如果需要引入其他 JavaScript 文件
5152]
5253
53- html_static_path = ['_static' ]
54+ # -- GitHub 相关配置 ---------------------------------------------------
55+ html_context = {
56+ # GitHub 仓库设置(必需)
57+ "display_github" : True , # 启用 GitHub 链接
58+ "github_user" : "tuya" , # 组织/用户名
59+ "github_repo" : "TuyaOpen" , # 仓库名
60+ "github_version" : "master" , # 默认分支(如 main/master)
61+
62+ # 页面路径配置(自动生成编辑链接)
63+ "conf_py_path" : "/docs/en/" , # 配置文件的仓库相对路径
64+ }
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ def setup(app):
3030# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
3131
3232html_theme = 'sphinx_rtd_theme'
33+ html_static_path = ['_static' ]
3334
3435html_theme_options = {
3536 'display_version' : True ,
@@ -50,4 +51,14 @@ def setup(app):
5051 'js/include_html.js' # 如果需要引入其他 JavaScript 文件
5152]
5253
53- html_static_path = ['_static' ]
54+ # -- GitHub 相关配置 ---------------------------------------------------
55+ html_context = {
56+ # GitHub 仓库设置(必需)
57+ "display_github" : True , # 启用 GitHub 链接
58+ "github_user" : "tuya" , # 组织/用户名
59+ "github_repo" : "TuyaOpen" , # 仓库名
60+ "github_version" : "master" , # 默认分支(如 main/master)
61+
62+ # 页面路径配置(自动生成编辑链接)
63+ "conf_py_path" : "/docs/zh/" , # 配置文件的仓库相对路径
64+ }
You can’t perform that action at this time.
0 commit comments