You've already forked uutils.github.io
mirror of
https://github.com/uutils/uutils.github.io.git
synced 2026-06-10 16:12:28 -07:00
Fix manpage build: remove deprecated mdbook field and fix index generation
- Strip 'multilingual' from book.toml before mdbook build (removed in newer versions) - Generate a self-contained manpages index.html instead of relying on Zola (the Zola approach failed due to wrong paths and content conflict with coreutils.md) - Copy manpage HTML files in the collect step so they end up at /coreutils/manpages/
This commit is contained in:
@@ -70,38 +70,60 @@ jobs:
|
||||
run: |
|
||||
mkdir -p manpages-html
|
||||
|
||||
# Create JSON list for dynamic loading
|
||||
echo "[" > manpages-html/manpages.json
|
||||
first=true
|
||||
|
||||
# Convert manpages to HTML
|
||||
# Convert manpages to HTML and collect names
|
||||
manpage_names=""
|
||||
for man in manpages/usr/local/share/man/man*/*.1; do
|
||||
if [ -f "$man" ]; then
|
||||
name=$(basename "$man" .1)
|
||||
man2html -r "$man" > "manpages-html/${name}.html"
|
||||
|
||||
# Add to JSON list
|
||||
if [ "$first" = true ]; then
|
||||
echo " \"${name}\"" >> manpages-html/manpages.json
|
||||
first=false
|
||||
else
|
||||
echo " ,\"${name}\"" >> manpages-html/manpages.json
|
||||
fi
|
||||
manpage_names="$manpage_names $name"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "]" >> manpages-html/manpages.json
|
||||
# Generate index.html with links to all manpages
|
||||
cat > manpages-html/index.html << 'HEADER'
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>uutils coreutils - Manual Pages</title>
|
||||
<style>
|
||||
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; max-width: 1200px; margin: 0 auto; padding: 20px; }
|
||||
h1 { color: #333; }
|
||||
.breadcrumb { margin-bottom: 20px; }
|
||||
.breadcrumb a { color: #007acc; text-decoration: none; }
|
||||
.breadcrumb a:hover { text-decoration: underline; }
|
||||
.manpage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; margin-top: 30px; }
|
||||
.manpage-link { display: block; padding: 12px; background: #f5f5f5; border: 1px solid #ddd; border-radius: 5px; text-decoration: none; color: #333; text-align: center; font-family: monospace; font-weight: bold; font-size: 1.1em; transition: all 0.3s ease; }
|
||||
.manpage-link:hover { background: #007acc; color: white; border-color: #007acc; transform: translateY(-2px); box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body { background: #1a1a1a; color: #e0e0e0; }
|
||||
h1 { color: #e0e0e0; }
|
||||
.manpage-link { background: #2a2a2a; border-color: #444; color: #e0e0e0; }
|
||||
.manpage-link:hover { background: #007acc; color: white; border-color: #007acc; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="breadcrumb">
|
||||
<a href="/">Home</a> /
|
||||
<a href="/coreutils">Coreutils</a> /
|
||||
<span>Manual Pages</span>
|
||||
</div>
|
||||
<h1>Manual Pages</h1>
|
||||
<p>Complete manual pages for all uutils coreutils commands. Click on any command to view its full documentation.</p>
|
||||
<div class="manpage-grid">
|
||||
HEADER
|
||||
|
||||
# Create index page for Zola to process (picked up by the "Run Zola" step)
|
||||
cat > uutils.github.io/content/coreutils-manpages.md << 'EOF'
|
||||
+++
|
||||
title = "Manual Pages"
|
||||
template = "manpages.html"
|
||||
for name in $(echo $manpage_names | tr ' ' '\n' | sort); do
|
||||
echo " <a href=\"${name}.html\" class=\"manpage-link\">${name}</a>" >> manpages-html/index.html
|
||||
done
|
||||
|
||||
[extra]
|
||||
project = "coreutils"
|
||||
+++
|
||||
EOF
|
||||
cat >> manpages-html/index.html << 'FOOTER'
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
FOOTER
|
||||
|
||||
- name: Build Findutils Docs
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user