Skip to content

Commit 5f6238e

Browse files
dknaussclaude
andcommitted
Add YAML frontmatter, auto-date workflow, EPUB output, and release workflow
- Replace H1 heading and metadata block with YAML frontmatter (title, subtitle, author as General Editor, date, version) - Restructure cover content: metadata summary table and Emergency Quick-Reference Card now appear as pre-heading body content, placing them between the title page and TOC in PDF output - Workflow now auto-updates the date field on each build - Add EPUB as a third output format (Pandoc native, no extra deps) - Add release workflow that creates GitHub Releases on tag push with PDF, DOCX, and EPUB as downloadable assets - Simplify conversion step: metadata comes from frontmatter instead of being extracted/injected via CLI flags Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8c57ede commit 5f6238e

3 files changed

Lines changed: 66 additions & 27 deletions

File tree

.github/workflows/generate-docs.yml

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Generate PDF & Word Documents
1+
name: Generate PDF, Word & EPUB Documents
22

33
on:
44
push:
@@ -62,6 +62,18 @@ jobs:
6262
echo "Created default reference.docx (customise via Word to restyle DOCX output)"
6363
fi
6464
65+
- name: Update date in frontmatter
66+
run: |
67+
today=$(date '+%B %-d, %Y')
68+
find . -name "*.md" -not -name "README.md" \
69+
-not -path "./.github/*" -not -path "./node_modules/*" \
70+
| while read -r md_file; do
71+
if head -1 "$md_file" | grep -q '^---$'; then
72+
sed -i "s/^date: .*/date: \"$today\"/" "$md_file"
73+
echo " Updated date → $today in $md_file"
74+
fi
75+
done
76+
6577
- name: Convert Markdown files
6678
run: |
6779
find . \
@@ -74,39 +86,44 @@ jobs:
7486
7587
base="${md_file%.md}"
7688
77-
# Title: first H1 heading, else formatted filename
78-
title=$(grep -m1 "^# " "$md_file" 2>/dev/null | sed 's/^# //')
79-
[ -z "$title" ] && title=$(basename "${md_file%.md}" | tr '-' ' ')
80-
today=$(date '+%B %Y')
89+
# Read version from YAML frontmatter
90+
version=$(sed -n '/^---$/,/^---$/{ s/^version: *"\{0,1\}\([^"]*\)"\{0,1\}/\1/p }' "$md_file")
91+
display_date="Version ${version} — $(date '+%B %-d, %Y')"
8192
82-
echo "▶ $md_file → \"$title\""
93+
echo "▶ $md_file (${display_date})"
8394
95+
# PDF via eisvogel + XeLaTeX
8496
pandoc "$md_file" \
8597
--template eisvogel \
8698
--pdf-engine xelatex \
8799
--defaults ".github/pandoc/pdf-defaults.yaml" \
88-
--metadata "title=$title" \
89-
--metadata "date=$today" \
100+
--metadata "date=${display_date}" \
90101
--toc --toc-depth=3 --number-sections \
91102
-o "${base}.pdf" \
92103
&& echo " ✓ PDF" || echo " ✗ PDF failed"
93104
105+
# DOCX via reference template
94106
pandoc "$md_file" \
95107
--reference-doc=".github/pandoc/reference.docx" \
96-
--metadata "title=$title" \
97-
--metadata "date=$today" \
98108
--toc --toc-depth=3 \
99109
-o "${base}.docx" \
100110
&& echo " ✓ DOCX" || echo " ✗ DOCX failed"
111+
112+
# EPUB
113+
pandoc "$md_file" \
114+
--toc --toc-depth=3 \
115+
--epub-title-page=false \
116+
-o "${base}.epub" \
117+
&& echo " ✓ EPUB" || echo " ✗ EPUB failed"
101118
done
102119
103120
- name: Commit generated documents
104121
run: |
105122
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
106123
git config user.name "github-actions[bot]"
107-
git add *.pdf *.docx .github/pandoc/reference.docx 2>/dev/null || true
124+
git add *.md *.pdf *.docx *.epub .github/pandoc/reference.docx 2>/dev/null || true
108125
if ! git diff --staged --quiet; then
109-
git commit -m "docs: regenerate PDF and Word documents [skip ci]"
126+
git commit -m "docs: regenerate PDF, Word, and EPUB documents [skip ci]"
110127
git pull --rebase origin main
111128
git push
112129
else

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Create GitHub Release
18+
uses: softprops/action-gh-release@v2
19+
with:
20+
generate_release_notes: true
21+
files: |
22+
*.pdf
23+
*.docx
24+
*.epub

WP-Operations-Runbook.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
# WordPress Operations Runbook for [CUSTOMIZE: Domain/Instance]
2-
3-
|**Environment:**|
4-
|:----------------------------------------------|
5-
|[Stack/Details]|
6-
7-
<br /><br />
8-
9-
|**Version:**|**Last Updated:**|**Next Review:**|
10-
|:-----------|:----------------|:---------------|
11-
| #.#.# | [YYYY-MM-DD] | [YYYY-MM-DD] |
1+
---
2+
title: "WordPress Operations Runbook"
3+
subtitle: "Template for [CUSTOMIZE: Domain/Instance/Environment]"
4+
author: "General Editor: Dan Knauss"
5+
date: "March 2, 2026"
6+
version: "2.0"
7+
---
128

13-
|**Owner:**|
14-
|:----------------------------------------------|
15-
|[Team/Lead]|
9+
| Property | Value |
10+
|----------|-------|
11+
| **Next Review** | [CUSTOMIZE: Date] |
12+
| **Owner** | [CUSTOMIZE: Operations Team Name] |
13+
| **Environment** | [CUSTOMIZE: Stack Details; Production/Staging/Development] |
1614

1715
---
1816

19-
## Emergency Quick-Reference Card
17+
**Emergency Quick-Reference Card**
2018

2119
Use this table to quickly find solutions to common issues.
2220

0 commit comments

Comments
 (0)