@@ -16,20 +16,75 @@ For mobile devices or e-readers, you can also download an ePub copy (updated eve
1616[ latest] ( https://download.redotengine.org/docs/redot-docs-epub-master.zip ) . Extract
1717the ZIP archive then open the ` RedotEngine.epub ` file in an e-book reader application.
1818
19- ## Migrating
19+ ## Building Documentation
2020
21- We are transitioning from Godot to Redot. In this period, a temporary solution is available.
21+ ### Quick Build (Local Development)
2222
23+ For local development, use the optimized build script:
24+
25+ ``` bash
26+ # Full build (includes migration + Sphinx)
27+ FULL_RUN=1 ./build.sh
28+
29+ # The output will be in output/html/en/latest/ (for master branch)
30+ # or output/html/en/<branch-name>/ (for other branches)
2331```
24- python migrate.py . _migrated True
32+
33+ ** Build optimizations:**
34+ - ` --exclude-classes ` : Skips class reference migration (faster, these are auto-generated)
35+ - ` -j auto ` : Uses all available CPU cores for parallel builds
36+ - Branch mapping: ` master ` → ` latest/ ` , other branches → ` <branch-name>/ `
37+
38+ ### Manual Build
39+
40+ If you prefer manual control:
41+
42+ ``` bash
43+ # 1. Migrate (optional - skip for faster builds, use --exclude-classes)
44+ python migrate.py --exclude-classes . _migrated
45+
46+ # 2. Build with Sphinx (auto-detect CPU cores)
47+ sphinx-build -b html -j auto ./_migrated/ _build/html
2548```
2649
27- After the docs are converted, you can build with
50+ ### Architecture
51+
52+ ** GitHub Actions + Cloudflare Pages (Current):**
53+ - Source: This repository (` Redot-Engine/redot-docs ` )
54+ - Build: GitHub Actions runs ` build.sh ` (2-hour timeout vs Cloudflare's 20 minutes)
55+ - Deploy: Built output pushed to Cloudflare Pages
56+ - Output: ` /output/html/en/<branch>/ `
57+ - Serve: Cloudflare Pages serves the built documentation
58+
59+ ** Previous architectures (deprecated):**
60+ 1 . ~ Two repos: ` redot-docs ` (source) → builds → pushes to ` redot-docs-live ` (deployment)~
61+ 2 . ~ Direct Cloudflare Pages build (hit 20-minute timeout limit)~
62+
63+ ### GitHub Actions Workflow
64+
65+ The repository includes an automated workflow (` .github/workflows/build-and-deploy.yml ` ) that:
2866
67+ 1 . ** Builds on every push** to ` master ` or ` optimize-build-simplify `
68+ 2 . ** Runs on GitHub Actions** with a 2-hour timeout (vs Cloudflare's 20-minute limit)
69+ 3 . ** Deploys automatically** to Cloudflare Pages using the official Cloudflare action
70+
71+ ** Setup required:**
72+
73+ Add these secrets to your GitHub repository (Settings → Secrets and variables → Actions):
74+ - ` CLOUDFLARE_ACCOUNT_ID ` - Your Cloudflare account ID
75+ - ` CLOUDFLARE_API_TOKEN ` - API token with Cloudflare Pages: Edit permission
76+
77+ ** How it works:**
2978```
30- sphinx-build -b html ./_migrated/ _build/html
79+ Push to branch → GitHub Actions builds (30 min) → Deploys to Cloudflare Pages
3180```
3281
82+ ** Benefits:**
83+ - No 20-minute timeout limit
84+ - Python dependencies cached between builds
85+ - Automatic deployment on every push
86+ - Works for both production (master) and preview branches
87+
3388## Theming
3489
3590The Redot documentation uses the default ` sphinx_rtd_theme ` with many
@@ -58,24 +113,31 @@ Here are some quick links to the areas you might be interested in:
58113
59114### How to build with anaconda/miniconda
60115
61- ```
62- # 1) create env with Python 3.11
116+ ** Recommended: Use the build script**
117+ ``` bash
118+ # Setup environment (one-time)
63119conda create -n redot-docs python=3.11 -y
64-
65- # 2) activate it
66120conda activate redot-docs
121+ pip install -r requirements.txt
122+
123+ # Build documentation
124+ FULL_RUN=1 ./build.sh
67125
68- # 3) ensure pip is available (usually is)
69- conda install pip -y
126+ # Output: output/html/en/latest/
127+ ```
70128
71- # 4) from the repo root, install requirements via pip
72- python -m pip install -r requirements.txt
129+ ** Manual build (if you need fine control):**
130+ ``` bash
131+ # 1) Setup environment
132+ conda create -n redot-docs python=3.11 -y
133+ conda activate redot-docs
134+ pip install -r requirements.txt
73135
74- # 5) Migration
75- python migrate.py . _migrated True
136+ # 2) Migrate (use --exclude-classes for faster builds)
137+ python migrate.py --exclude-classes . _migrated
76138
77- # 6) build the docs
78- sphinx-build -b html ./_migrated/ _build/html
139+ # 3) Build with Sphinx (auto-detect CPU cores)
140+ sphinx-build -b html -j auto ./_migrated/ _build/html
79141```
80142
81143## License
0 commit comments