Skip to content

Conversation

@krystophny
Copy link
Collaborator

Problem

GitHub Pages continues to show 404 errors for example HTML documentation despite previous fixes:

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:

$ 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:

./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.

The pi symbol (π) in basic_plots.md was causing UTF-8 parsing errors in
the CI environment, preventing FORD from generating HTML files for:
- basic_plots.html
- annotation_demo.html
- colored_contours.html
- contour_demo.html

This resulted in 404 errors on GitHub Pages. Replaced π with 'pi' to
ensure ASCII-only content that works in all CI environments.

Fixes GitHub Pages 404 errors for example documentation.
… from example docs

Added scripts/clean_example_docs_utf8.sh to systematically remove UTF-8
non-ASCII characters from example documentation files that were causing
FORD parsing failures in CI environments.

Fixed files:
- animation.md: Removed UTF-8 checkmark symbols
- smart_show_demo.md: Removed UTF-8 pi symbol and arrow symbols

All example/*.md files are now pure us-ascii encoding, ensuring
compatibility with FORD in all CI environments.

This should resolve the GitHub Pages 404 errors by allowing FORD to
generate HTML files for all examples.
@krystophny krystophny enabled auto-merge (squash) August 23, 2025 19:27
@codecov
Copy link

codecov bot commented Aug 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@krystophny krystophny merged commit aa1d62b into main Aug 23, 2025
5 checks passed
@krystophny krystophny deleted the fix/comprehensive-ascii-cleaning branch August 23, 2025 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants