mystx#
mystx - 现代化 Sphinx 文档主题
This module provides a custom Sphinx theme for creating beautiful, modern documentation. The theme includes configuration management, styling, and integration with Sphinx.
1. Submodules#
2. Classes#
mystx主题管理类,负责整合主题信息管理和配置功能。 |
3. Functions#
|
config-inited 事件处理器 |
|
Sphinx extension setup. |
4. Package Contents#
- class mystx.MySTX[源代码]#
mystx主题管理类,负责整合主题信息管理和配置功能。
该类负责查找主题目录、注册主题到Sphinx应用。
- Attributes:
app: Sphinx应用实例,用于注册主题和连接事件。 name: 主题名称,默认为"mystx"。 theme_dir: 主题目录路径,初始化后自动设置。
- app: sphinx.application.Sphinx#
- name: str = 'mystx'#
- theme_dir: str | None#
- mystx.config_inited_handler(app: sphinx.application.Sphinx, config: sphinx.config.Config) None[源代码]#
config-inited 事件处理器
在 Sphinx 完成配置对象(Config)初始化后立即触发,让你有机会在构建器(Builder)创建之前,读取或修改配置。
- 触发时机:
发生在:conf.py 执行完毕,所有配置变量已收集并封装到 Config 对象中。
早于:builder-inited(构建器初始化)事件。
- 晚于:扩展加载(extensions 列表中的扩展已导入)。
因为 extensions 已经加载完毕,所以在 config-inited 中修改 extensions 列表不会重新加载扩展。 如果需要动态加载扩展,应使用 app.setup_extension()。
- Args:
app: Sphinx应用实例 config: Sphinx配置对象