Documentation & Building
This documentation is built with MkDocs + the Material theme + the i18n plugin. The source is the docs/ folder.
Local preview
pip install "mkdocs>=1.6" "mkdocs-material>=9.7,<9.8" "mkdocs-static-i18n>=1.0"
mkdocs serve # default http://127.0.0.1:8000, with live reload
Version requirements
- mkdocs-static-i18n must be ≥ 1.0. The 0.x line reads the material version and language list through
pkg_resources, which setuptools ≥ 81 removed, and material 9.6 moved its templates tomaterial/templates/partials/. With 0.x the plugin concludes that material is missing, so no language switcher is generated and<html lang>never changes — the site silently degrades to Chinese-only. - material 9.7.2+ changed internal interfaces the plugin relies on; 9.7.1 is the safest choice. After upgrading material, run
mkdocs build --strictagain and confirm the switcher still renders.
Build the static site
mkdocs build --strict # output to site/; --strict fails on broken links, missing translations or pages absent from nav
mkdocs gh-deploy # publish to GitHub Pages
Output layout (the default language zh sits at the site root):
site/
├── index.html # Chinese (default language)
├── en/ # English
├── search/ # shared bilingual search index (per-language stemming)
└── sitemap.xml
Directory convention
docs/
├── zh/ # Chinese (default language)
└── en/ # English
Each language folder shares the same structure: index.md, about.md, guide/, dev/, api/
- Adding a page: create a same-named file in both
zh/anden/, then register it in thenavofmkdocs.yml. - Chinese → English navigation mappings live under
nav_translationsof thelocale: enentry inlanguages(since 1.x this is per language, not a top-level option). - The English site title can be overridden with
site_nameon thelocale: enentry.
Code conventions (for contributors)
- File names: UI feature pages use Chinese pinyin (e.g.
shouye.py= Home,shezhi.py= Settings); library modules such ascore/,functions/use English. - Layering: computation logic goes in
functions/(pure functions, no Qt); UI goes inui/; shared services go incore/. - Docstrings: public functions / classes should have docstrings to support the API reference.
- Lazy loading: new UI modules must be registered in
_submodulesofui/__init__.pyto benefit from faster startup.
Documentation categories
This help site is split into three categories for different readers:
- User Guide (
guide/): for end users — installation, configuration, and how to use each feature. - Developer Guide (
dev/): for contributors — architecture, how to add a feature, internationalization, and building docs. - API Reference (
api/): for integrators — the public functions of eachcore/andfunctions/module.
Contribution workflow
- Fork the repository and create a branch.
- Update docs in both
docs/zhanddocs/en. - Run
mkdocs build --strictlocally to confirm no broken links / missing translations. - Open a Pull Request.