Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/example/animation.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ contains
case (-5)
print *, "ERROR: Failed to generate animation frames."
case (-6)
print *, " Pipe write failed - enhanced recovery attempted (Issue #186: exponential backoff exhausted)"
print *, " Pipe write failed - enhanced recovery attempted (Issue #186: exponential backoff exhausted)"
case (-7)
print *, "ERROR: Generated video failed validation. Check ffmpeg version."
case default
Expand Down
2 changes: 1 addition & 1 deletion doc/example/basic_plots.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ contains

print *, "=== Basic Plots ==="

! Generate simple sine data - show 2 complete periods (0 to )
! Generate simple sine data - show 2 complete periods (0 to 4pi)
x = [(real(i-1, wp) * 4.0_wp * 3.141592653589793_wp / 49.0_wp, i=1, 50)]
y = sin(x)

Expand Down
10 changes: 5 additions & 5 deletions doc/example/smart_show_demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ program smart_show_demo
call title('Smart Show Demo - Damped Oscillation')
call xlabel('Time')
call ylabel('Amplitude')
call plot(x, y, label='exp(-t)*cos(2πt)', linestyle='b-o')
call plot(x, y, label='exp(-t)*cos(2t)', linestyle='b-o')
call legend()

! Display using intelligent show()
Expand Down Expand Up @@ -75,9 +75,9 @@ end program smart_show_demo
- SSH session detection

2. **Select backend**:
- GUI available PNG viewer
- Terminal only ASCII output
- File output User specified
- GUI available PNG viewer
- Terminal only ASCII output
- File output User specified

3. **Fallback chain**:
- Try PNG viewer
Expand Down Expand Up @@ -109,5 +109,5 @@ Smart Plot Display
| *
-1.0 | **
+---------------
0
0 2
```
75 changes: 75 additions & 0 deletions scripts/clean_example_docs_utf8.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash
# Clean all non-ASCII characters from example documentation files
# This ensures FORD can parse them correctly in all CI environments

set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
EXAMPLE_DIR="$PROJECT_ROOT/doc/example"

echo "=== Cleaning UTF-8 non-ASCII characters from example documentation ==="
echo "Project root: $PROJECT_ROOT"
echo "Example directory: $EXAMPLE_DIR"
echo ""

if [[ ! -d "$EXAMPLE_DIR" ]]; then
echo "ERROR: Example directory not found: $EXAMPLE_DIR"
exit 1
fi

# Function to clean a single file
clean_file() {
local file="$1"
local basename=$(basename "$file")

echo "Processing: $basename"

# Check current encoding
local encoding=$(file -bi "$file" | cut -d'=' -f2)
echo " Current encoding: $encoding"

# Create backup
cp "$file" "${file}.backup"

# Use tr to remove all non-ASCII characters (safer than sed with complex UTF-8)
# Keep only printable ASCII characters: tab(9), newline(10), carriage return(13), space(32) through tilde(126)
tr -cd '\11\12\15\40-\176' < "$file" > "${file}.temp"
mv "${file}.temp" "$file"

# Check final encoding
local new_encoding=$(file -bi "$file" | cut -d'=' -f2)
echo " New encoding: $new_encoding"

# Show what changed
if ! cmp -s "$file" "${file}.backup"; then
echo " Changes made to file"
# Show diff but limit output
diff -u "${file}.backup" "$file" | head -20 || true
echo " ..."
else
echo " No changes needed"
fi

echo ""
}

# Find and process all markdown files
echo "Finding markdown files in $EXAMPLE_DIR..."
find "$EXAMPLE_DIR" -name "*.md" -type f | while read -r file; do
clean_file "$file"
done

echo "=== Summary ==="
echo "Processed files:"
find "$EXAMPLE_DIR" -name "*.md" -type f | while read -r file; do
basename=$(basename "$file")
encoding=$(file -bi "$file" | cut -d'=' -f2)
echo " $basename: $encoding"
done

echo ""
echo "Backup files created with .backup extension"
echo "To remove backups: find $EXAMPLE_DIR -name '*.backup' -delete"
echo ""
echo "=== Cleaning completed ==="
Loading