-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconf.py
More file actions
82 lines (65 loc) · 2.3 KB
/
conf.py
File metadata and controls
82 lines (65 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
import os
import sys
import re
import docutils.nodes
sys.path.insert(0, os.path.abspath('_sphinx_spec'))
project = 'Caturra的中文转录小站'
copyright = '2025, Caturra'
author = 'Caturra'
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
"revitron_sphinx_theme",
"myst_parser",
"sphinxcontrib.jquery",
"private_sphinx_sitemap",
]
autodoc_default_options = {
'autosummary': False
}
html_baseurl = "https://uni.bluepuni.com"
html_theme = 'revitron_sphinx_theme'
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_static_path = ['_static', 'images']
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}
html_theme_options = {
'navigation_depth': 5,
'github_url' : 'https://github.com/Caturra000/Transcripts'
}
# 生产模式开启 Jekyll 风味
# 调试模式保持默认 .html 后缀
# 调试模式通过环境变量开启
if os.getenv('CATURRA_SPHINX_DEBUG') is not None:
html_link_suffix = '.html'
print("NOTE: 本地调试模式,链接后缀设置为.html")
else:
html_link_suffix = '/'
html_title = 'Caturra的中文转录小站'
# 个人习惯起手 H2 标签
suppress_warnings = ["myst.header"]
# 用于 sitemap 插件
sitemap_url_scheme = "/{link}"
sitemap_excludes = [
"search/",
"genindex/",
]
# 提供人类可读的内部链接
# 尽可能接近 Jekyll 风味
docutils.nodes.make_id = lambda s: re.sub(
r'[\s-]+', '-',
re.sub(r'[^\w\s-]', '', s.strip().lower())
).strip('-') or 'id'
# TODO: 可能需要 robots.txt,但是硬编码 URL 并不妥
# 考虑在私有的 Sphinx 插件中插入一个生成文件的实现,复用 baseurl 配置