Skip to main content

mystx 主题 - 基于 sphinx-book-theme 的现代 Sphinx 文档主题

Project description

MySTX

repo size PyPI GitHub issues GitHub forks GitHub stars GitHub license contributors Documentation Status Downloads PyPI - Downloads

mystx 是基于 Sphinx Book Theme 的现代化、可定制的 Sphinx HTML 主题,为技术文档提供优雅美观的展示效果。它结合了现代Web设计理念与优秀的阅读体验,使您的文档既专业又易于阅读。

✨ 特性

  • 🎨 基于 Sphinx Book Theme 的现代化设计风格
  • 🛠️ 灵活的配置系统,支持从 TOML 文件加载默认配置
  • 📝 完善的 MyST Markdown 和 Jupyter Notebook 支持
  • 🚀 简单易用的主题注册和配置应用流程
  • 📚 丰富的可选扩展,用于增强文档功能

🔧 安装

基本安装

使用 pip 安装 mystx 主题:

pip install mystx

安装文档扩展

如果需要使用文档扩展功能,可以安装可选依赖:

pip install "mystx[doc]"

开发环境安装

对于开发者,可以安装开发依赖:

pip install -ve .[dev]

📋 依赖

核心依赖

  • sphinx-book-theme>=1.1.4 (主题继承)
  • sphinx>=8.0.0 (文档生成引擎)
  • myst-nb (Jupyter Notebook 支持)
  • myst-parser (MyST Markdown 解析器)
  • Python 3.12+ (运行环境)

可选依赖

文档扩展依赖包括:ablog, ipywidgets, numpy, matplotlib, sphinx-comments 等多个扩展,用于增强文档功能。

🚀 快速开始

在您的 Sphinx 项目的 conf.py 文件中,添加以下配置来使用 mystx 主题:

# 设置 HTML 主题
html_theme = "mystx"

# 主题选项配置
html_theme_options = {
    # 您的主题选项配置
}

# 配置插件
extensions = [
    "mystx",
    "sphinx.ext.napoleon",  # 支持 Google 和 NumPy 风格的文档字符串
    "sphinx_thebe",  # 支持 Thebe 交互式代码执行
    # 其他需要的扩展
]

⚙️ 配置指南

主题选项

mystx 主题支持通过 html_theme_options 配置各种选项,例如:

html_theme_options = {
    "repository_url": "https://github.com/yourusername/yourproject",
    "use_repository_button": True,
    "use_issues_button": True,
    "use_edit_page_button": True,
    "path_to_docs": "docs/",
    "home_page_in_toc": True,
    # 更多配置选项...
}

默认配置文件

mystx 支持通过 default.toml 文件加载默认配置。在您的 Sphinx 项目根目录创建 default.toml 文件:

[html_theme_options]
repository_url = "https://github.com/yourusername/yourproject"
use_repository_button = true
use_issues_button = true
# 更多配置选项...

📚 文档

请访问 mystx 官方文档 了解更多详细信息和使用示例。

🔗 链接

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mystx-0.2.2.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mystx-0.2.2-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file mystx-0.2.2.tar.gz.

File metadata

  • Download URL: mystx-0.2.2.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mystx-0.2.2.tar.gz
Algorithm Hash digest
SHA256 eeb755c4ace2dd586b4db10551032cba090c5747c5b6a217aeff09499cf9e84c
MD5 1a7010658fff244c01caab9a378a77da
BLAKE2b-256 c3b907b34a03c35e6aa071c0e1180d0c6c1ecfdb8695f141ec2299ec8eb3ed61

See more details on using hashes here.

File details

Details for the file mystx-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: mystx-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mystx-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1f267b93310b4b7848997714abca061a98294b8a3e634927e3c3051552c314ee
MD5 ffe8c8b1ddc6fc46514bbef0034adcea
BLAKE2b-256 9d01fa43eaf8d62112b947f4f7bc5a99dd9b2b49a6196bfb94b28496388ad5c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page