Skip to content

Conversation

@krystophny
Copy link
Collaborator

Problem

GitHub Pages was showing 404 errors for example HTML documentation pages like:

Root Cause Analysis

The GitHub Actions workflow in .github/workflows/docs.yml was:

  1. Running make doc which calls ford README.md to generate HTML files from doc/example/*.md
  2. Then copying the original doc/example/*.md files to build/doc/page/example/
  3. This overwrote the generated basic_plots.html with basic_plots.md

FORD correctly processes markdown files and generates HTML, but the workflow was destroying the output.

Solution

Remove the problematic copy step that overwrites FORD-generated HTML files:

# REMOVED: Copy example documentation pages to build directory  
# mkdir -p build/doc/page/example
# cp -r doc/example/*.md build/doc/page/example/ 2>/dev/null || true

Verification

Local testing confirms:

  • make doc generates build/doc/page/example/basic_plots.html
  • FORD processes all example markdown files correctly
  • HTML files contain proper documentation content

This fix will resolve the GitHub Pages 404 errors.

The GitHub Actions workflow was copying markdown files from doc/example/*.md
to build/doc/page/example/ AFTER FORD had already generated the HTML files.
This overwrote the generated basic_plots.html with basic_plots.md, causing
404 errors for HTML pages.

FORD correctly processes doc/example/*.md and generates HTML files.
The extra copy step was unnecessary and destructive.

Fixes GitHub Pages 404 errors for example HTML documentation.
@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 enabled auto-merge (squash) August 23, 2025 19:06
@krystophny krystophny merged commit accfa1b into main Aug 23, 2025
5 checks passed
@krystophny krystophny deleted the fix/github-actions-html-overwrite branch August 23, 2025 19:06
krystophny added a commit that referenced this pull request Aug 23, 2025
…220)

## Problem

GitHub Pages was still showing 404 errors for example HTML documentation
after PR #219, specifically:
- https://lazy-fortran.github.io/fortplot/page/example/basic_plots.html
-
https://lazy-fortran.github.io/fortplot/page/example/annotation_demo.html

## Root Cause Analysis  

Investigation of CI logs revealed that FORD was still reporting UTF-8
parsing errors for specific files:

```
Warning: Error parsing '/home/runner/work/fortplot/fortplot/doc/example/basic_plots.md'. utf-8
```

These UTF-8 parsing errors were preventing FORD from generating HTML
files for those documents.

## The Issue

A single UTF-8 character (π symbol) in `basic_plots.md` was causing the
problem:

```fortran  
! Generate simple sine data - show 2 complete periods (0 to 4π)
```

While this works fine in local development environments, the CI
environment has stricter UTF-8 handling that caused FORD parsing to
fail.

## Solution

Replace the π symbol with ASCII 'pi':

```fortran
! Generate simple sine data - show 2 complete periods (0 to 4pi)  
```

## Verification

- Local testing: `file -bi doc/example/basic_plots.md` now returns
`charset=us-ascii`
- All example markdown files are now ASCII-only
- FORD should generate HTML files successfully in CI

This final fix should resolve the remaining GitHub Pages 404 errors.
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