1+ # Configuration file for the Sphinx documentation builder.
2+ #
3+ # For the full list of built-in configuration values, see the documentation:
4+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
5+ import datetime
6+ import sys
7+ from pathlib import Path
8+ from contextlib import suppress
9+
10+ # -- Project information -----------------------------------------------------
11+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
12+
13+ project = 'MCDR-Plugins'
14+ copyright = f'{ datetime .datetime .now ().year } , xieyuen'
15+ author = 'xieyuen'
16+ release = '0.1.0'
17+
18+ src = Path (__file__ ).parent .parent .parent / "src"
19+ dependencies = Path (__file__ ).parent .parent .parent / "dependencies"
20+
21+ for directory in src .iterdir ():
22+ sys .path .append (str (directory ))
23+
24+ with suppress (FileNotFoundError ):
25+ for directory in dependencies .iterdir ():
26+ sys .path .append (str (directory ))
27+
28+ # -- General configuration ---------------------------------------------------
29+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
30+
31+ extensions = [
32+ 'sphinx.ext.autodoc' ,
33+ 'sphinx.ext.autosectionlabel' ,
34+ 'sphinx.ext.intersphinx' ,
35+ 'sphinx.ext.napoleon' ,
36+ 'sphinx.ext.viewcode' ,
37+ 'sphinx_copybutton' ,
38+ 'sphinx_prompt' ,
39+
40+ # For codeblock tabs
41+ # https://github.com/pradyunsg/sphinx-inline-tabs
42+ 'sphinx_inline_tabs' ,
43+
44+ # Mermaid graphs
45+ # https://github.com/mgaitan/sphinxcontrib-mermaid
46+ 'sphinxcontrib.mermaid' ,
47+
48+ # https://sphinx-design.readthedocs.io/en/latest/index.html
49+ # 'sphinx_design',
50+
51+ # https://pypi.org/project/sphinxcontrib.asciinema/
52+ 'sphinxcontrib.asciinema'
53+ ]
54+
55+ templates_path = ['_templates' ]
56+ exclude_patterns = []
57+
58+ language = 'zh_CN'
59+
60+ # -- Options for HTML output -------------------------------------------------
61+ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
62+
63+ html_theme = 'sphinx_rtd_theme'
64+ html_static_path = ['_static' ]
65+ html_css_files = ['custom.css' ]
66+
67+ # -- extension configuations -------------------------------------------------
68+
69+ # 常用的外部文档链接映射
70+ intersphinx_mapping = {
71+ 'mcdreforged' : ('https://docs.mcdreforged.com/zh-cn/latest/' , None ),
72+ }
73+ autodoc_default_options = {
74+ 'members' : True , # 显示所有成员
75+ 'member-order' : 'bysource' , # 按源代码顺序
76+ 'special-members' : '__init__' , # 显示特殊方法
77+ 'undoc-members' : True , # 显示没有文档的成员
78+ 'show-inheritance' : True , # 显示继承关系
79+ }
80+ # napoleon_use_ivar = True # 使用 :ivar: 而不是生成独立的属性文档
81+
82+ # 删除线样式
83+ rst_prolog = """
84+ .. role:: del
85+ :class: del
86+ """
0 commit comments