|
| 1 | +# 🚨 CRITICAL: GitHub Pages Documentation System |
| 2 | + |
| 3 | +**NEVER BREAK THIS SYSTEM AGAIN!** |
| 4 | + |
| 5 | +## GitHub Pages Visual Showcase Architecture |
| 6 | + |
| 7 | +This repository has a WORKING GitHub Pages system that displays example outputs (PNG images, PDFs, ASCII art) directly on the documentation website at https://lazy-fortran.github.io/fortplot/ |
| 8 | + |
| 9 | +### How The System Works |
| 10 | + |
| 11 | +1. **Example Generation**: GitHub Actions runs `make example` to generate outputs in `output/example/fortran/{example_name}/` |
| 12 | +2. **Media Directory Structure**: Files are copied to `doc/media/examples/{example_name}/` preserving directory structure |
| 13 | +3. **FORD Documentation**: FORD processes `doc.md` with `media_dir: ./doc/media` configuration |
| 14 | +4. **Markdown References**: Documentation files in `doc/examples/*.md` reference images as `../../media/examples/{example_name}/filename.png` |
| 15 | +5. **Final Build**: `make doc` copies everything to `build/doc/` and GitHub Pages deploys it |
| 16 | + |
| 17 | +### 🚨 CRITICAL PATH STRUCTURE |
| 18 | + |
| 19 | +**File Storage Location**: `media/examples/{example_name}/filename.png` |
| 20 | +**Documentation Reference**: `../../media/examples/{example_name}/filename.png` |
| 21 | + |
| 22 | +**Example**: |
| 23 | +- File exists at: `media/examples/basic_plots/simple_plot.png` |
| 24 | +- Referenced in markdown as: `` |
| 25 | + |
| 26 | +### Rules to NEVER Break |
| 27 | + |
| 28 | +1. **NEVER** change the GitHub Actions workflow copy commands without updating markdown references |
| 29 | +2. **NEVER** flatten the directory structure - examples MUST be in subdirectories |
| 30 | +3. **NEVER** modify `doc.md` media_dir configuration without understanding the full pipeline |
| 31 | +4. **NEVER** change image paths in one place without updating the other |
| 32 | + |
| 33 | +### Common Breaking Changes to Avoid |
| 34 | + |
| 35 | +❌ **Don't do this**: Copy files to `doc/media/examples/filename.png` (flat structure) |
| 36 | +✅ **Always do this**: Copy files to `doc/media/examples/{example_name}/filename.png` (subdirectory structure) |
| 37 | + |
| 38 | +❌ **Don't do this**: Reference `../../media/examples/filename.png` in markdown |
| 39 | +✅ **Always do this**: Reference `../../media/examples/{example_name}/filename.png` in markdown |
| 40 | + |
| 41 | +### Testing Before Changes |
| 42 | + |
| 43 | +Before modifying anything related to documentation: |
| 44 | + |
| 45 | +1. Run `make example` to generate outputs |
| 46 | +2. Run `make doc` to build documentation |
| 47 | +3. Check `build/doc/page/examples/basic_plots.html` shows images properly |
| 48 | +4. Verify file exists at `build/doc/media/examples/basic_plots/simple_plot.png` |
| 49 | + |
| 50 | +### Historical Context |
| 51 | + |
| 52 | +- **Commit 416f7d3**: Destroyed the working system by removing FORD documentation |
| 53 | +- **Restoration**: System was restored with proper FORD configuration and directory structure |
| 54 | +- **Critical Fix (Aug 25, 2025)**: Fixed path mismatch between storage and references |
| 55 | + |
| 56 | +### Emergency Recovery |
| 57 | + |
| 58 | +If GitHub Pages shows broken images: |
| 59 | +1. Check if files exist in `build/doc/media/examples/{example_name}/` |
| 60 | +2. Check if markdown files reference correct paths with subdirectories |
| 61 | +3. Verify GitHub Actions workflow preserves directory structure |
| 62 | +4. Compare with this working commit: 0b2b032 |
| 63 | + |
| 64 | +## 🔒 DO NOT TOUCH UNLESS YOU UNDERSTAND THE FULL PIPELINE |
| 65 | + |
| 66 | +The user explicitly requested this visual showcase. Breaking it again will cause significant frustration. |
0 commit comments