You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: comprehensive ASCII cleaning script to resolve all FORD UTF-8 parsing errors (#221)
## Problem
GitHub Pages continues to show 404 errors for example HTML documentation
despite previous fixes:
- https://lazy-fortran.github.io/fortplot/page/example/basic_plots.html
-
https://lazy-fortran.github.io/fortplot/page/example/annotation_demo.html
- And many others
## Root Cause Analysis
Investigation revealed that FORD in the CI environment was still
reporting UTF-8 parsing errors for multiple files:
```
Warning: Error parsing '/home/runner/work/fortplot/fortplot/doc/example/basic_plots.md'. utf-8
Warning: Error parsing '/home/runner/work/fortplot/fortplot/doc/example/annotation_demo.md'. utf-8
Warning: Error parsing '/home/runner/work/fortplot/fortplot/doc/example/colored_contours.md'. utf-8
...
```
These parsing errors prevent FORD from generating HTML files, causing
404 errors on GitHub Pages.
## The Solution
Created a comprehensive UTF-8 cleaning script
`scripts/clean_example_docs_utf8.sh` that:
1. **Systematically processes all example markdown files**
2. **Removes ALL non-ASCII characters** using `tr -cd
'\11\12\15\40-\176'`
3. **Preserves essential characters**: tabs, newlines, carriage returns,
and printable ASCII (32-126)
4. **Creates backups** for safety
5. **Reports encoding changes** for transparency
## Files Fixed
- **animation.md**: Removed UTF-8 checkmark symbols (✗)
- **smart_show_demo.md**: Removed UTF-8 pi symbol (π) and arrow symbols
(→)
- All other files were already clean or are now verified ASCII-only
## Verification
All example files are now confirmed `us-ascii` encoding:
```bash
$ for file in doc/example/*.md; do echo "$(basename "$file"): $(file -bi "$file" | cut -d'=' -f2)"; done
animation.md: us-ascii
annotation_demo.md: us-ascii
basic_plots.md: us-ascii
colored_contours.md: us-ascii
contour_demo.md: us-ascii
... (all us-ascii)
```
## Future Prevention
The script can be run anytime to ensure all example documentation
remains FORD-compatible:
```bash
./scripts/clean_example_docs_utf8.sh
```
This comprehensive fix should resolve all remaining GitHub Pages 404
errors by ensuring FORD can parse every example file successfully in any
CI environment.
0 commit comments