This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the QPython website and documentation repository (www.qpython.org). QPython is a Python script engine for Android devices. The site is built with Sphinx using reStructuredText (.rst) source files.
All build commands should be run from the qpython-docs/ directory:
cd qpython-docsBuild HTML documentation for local testing:
make htmlOutput will be in qpython-docs/build/html/. Open build/html/index.html in a browser to preview.
Build the full site including analytics, static file processing, and copy to the deployment directory:
./build.shThis script:
- Removes the existing
docs/folder at the repository root - Runs
make htmlto build the documentation - Adds Google Analytics and Facebook comments via
add-analytics.py - Renames
_static/tostatic/and_images/toimages/ - Copies additional static files (CNAME, favicon.ico, index.html, privacy pages, etc.)
- Outputs final site to
/docs/(which is deployed via GitHub Pages)
make clean # Remove build artifacts
make linkcheck # Check for broken external links
make doctest # Run doctests in documentationqpython-docs/
├── source/ # Documentation source files (.rst)
│ ├── document.rst # Main toctree (entry point)
│ ├── conf.py # Sphinx configuration
│ ├── _static/ # Static assets (CSS, images)
│ ├── en/ # English documentation
│ │ ├── guide.rst
│ │ ├── faq.rst
│ │ └── ...
│ ├── zh/ # Chinese documentation
│ └── qpython_theme/ # Custom Sphinx theme
│ └── __init__.py
├── build.sh # Production build script
├── add-analytics.py # Post-processor for analytics injection
├── extra.txt # Analytics code template
├── requirements.txt # Python dependencies
└── Makefile # Sphinx build commands
docs/ # Built site (deployment target)
├── index.html # Site homepage
├── document.html # Documentation homepage
├── en/ # Built English docs
├── _sources/ # Source archives (for Sphinx)
└── ...
qpython-docs/source/conf.py: Sphinx configuration including theme (qpython_theme), version, and extensionsqpython-docs/source/document.rst: Main documentation entry point with toctreeqpython-docs/build.sh: Production build script that processes the Sphinx output and prepares it for deploymentqpython-docs/extra.txt: Template for injecting Google Analytics and Facebook comments into HTMLdocs/CNAME: Configures custom domain (www.qpython.org) for GitHub Pages
The documentation uses a custom Sphinx theme located at qpython-docs/source/qpython_theme/. The theme path is registered in conf.py via the qpython_theme package.
- English:
qpython-docs/source/en/ - Chinese:
qpython-docs/source/zh/
Each language has its own toctree structure. The master document (document.rst) includes the English guide by default and links to Chinese content via zhindex.rst.
The docs/ folder at the repository root is the deployment target. It is served via GitHub Pages. After making changes:
- Run
./build.shto rebuild the site - Commit the changes in both
qpython-docs/source/(source) anddocs/(built output) - Push to deploy