Skip to content

Commit 2126847

Browse files
authored
Merge pull request #172 from Community-Access/epub-typesetting
Add EPUB and Word (.docx) export pipeline
2 parents 79533ce + e8d7707 commit 2126847

File tree

7 files changed

+531
-0
lines changed

7 files changed

+531
-0
lines changed

.github/workflows/build-epub.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build EPUB and Word
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'docs/**'
8+
- 'epub/metadata.yaml'
9+
- 'epub/epub.css'
10+
- 'epub/pdf.css'
11+
- 'scripts/build-epub.js'
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: write
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Install Pandoc
25+
run: |
26+
sudo apt-get update -qq
27+
sudo apt-get install -y pandoc
28+
29+
- name: Set up Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 20
33+
34+
- name: Build EPUB and Word
35+
run: node scripts/build-epub.js
36+
37+
- name: Upload EPUB artifact
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: git-going-with-github-epub
41+
path: epub/git-going-with-github.epub
42+
retention-days: 90
43+
44+
- name: Upload Word artifact
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: git-going-with-github-word
48+
path: epub/git-going-with-github.docx
49+
retention-days: 90
50+
51+
- name: Commit outputs to repository
52+
run: |
53+
git config user.name "github-actions[bot]"
54+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
55+
git add epub/git-going-with-github.epub epub/git-going-with-github.docx
56+
if [ -n "$(git status --porcelain)" ]; then
57+
git commit -m "chore: rebuild EPUB and Word from latest docs"
58+
git push
59+
else
60+
echo "No changes to commit"
61+
fi

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,5 @@ podcasts/tts/samples/
165165
*.onnx
166166
*.onnx.json
167167
*.wav
168+
epub/git-going-with-github.epub
169+
epub/git-going-with-github.docx

epub/epub.css

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
/* GIT Going with GitHub — EPUB Stylesheet */
2+
3+
/* ---- Body & typography ---- */
4+
body {
5+
font-family: Georgia, "Times New Roman", serif;
6+
font-size: 1em;
7+
line-height: 1.7;
8+
color: #1a1a1a;
9+
margin: 0;
10+
padding: 0;
11+
}
12+
13+
/* ---- Headings ---- */
14+
h1, h2, h3, h4, h5, h6 {
15+
font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
16+
font-weight: 700;
17+
line-height: 1.3;
18+
margin-top: 1.5em;
19+
margin-bottom: 0.5em;
20+
page-break-after: avoid;
21+
}
22+
23+
h1 {
24+
font-size: 1.9em;
25+
border-bottom: 2px solid #1a1a1a;
26+
padding-bottom: 0.3em;
27+
page-break-before: always;
28+
}
29+
30+
/* Don't page-break before the very first chapter */
31+
h1:first-child {
32+
page-break-before: avoid;
33+
}
34+
35+
h2 { font-size: 1.4em; }
36+
h3 { font-size: 1.15em; }
37+
h4 { font-size: 1em; font-style: italic; }
38+
39+
/* ---- Paragraphs ---- */
40+
p {
41+
margin-top: 0;
42+
margin-bottom: 0.9em;
43+
orphans: 3;
44+
widows: 3;
45+
}
46+
47+
/* ---- Links ---- */
48+
a {
49+
color: #0550ae;
50+
text-decoration: underline;
51+
}
52+
53+
/* ---- Code ---- */
54+
code, kbd, samp {
55+
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
56+
font-size: 0.88em;
57+
background: #f3f4f6;
58+
padding: 0.1em 0.35em;
59+
border-radius: 3px;
60+
}
61+
62+
pre {
63+
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
64+
font-size: 0.82em;
65+
background: #f3f4f6;
66+
border: 1px solid #d1d5db;
67+
border-radius: 4px;
68+
padding: 1em;
69+
overflow-x: auto;
70+
white-space: pre-wrap;
71+
word-break: break-word;
72+
page-break-inside: avoid;
73+
}
74+
75+
pre code {
76+
background: none;
77+
padding: 0;
78+
border-radius: 0;
79+
font-size: 1em;
80+
}
81+
82+
/* ---- Blockquotes ---- */
83+
blockquote {
84+
margin: 1em 0 1em 1.5em;
85+
padding-left: 1em;
86+
border-left: 3px solid #9ca3af;
87+
color: #4b5563;
88+
font-style: italic;
89+
}
90+
91+
/* ---- Lists ---- */
92+
ul, ol {
93+
margin: 0.5em 0 0.9em 1.5em;
94+
padding: 0;
95+
}
96+
97+
li {
98+
margin-bottom: 0.3em;
99+
}
100+
101+
/* ---- Tables ---- */
102+
table {
103+
width: 100%;
104+
border-collapse: collapse;
105+
margin: 1em 0;
106+
font-size: 0.9em;
107+
page-break-inside: avoid;
108+
}
109+
110+
th, td {
111+
border: 1px solid #d1d5db;
112+
padding: 0.5em 0.75em;
113+
text-align: left;
114+
vertical-align: top;
115+
}
116+
117+
th {
118+
background: #f3f4f6;
119+
font-weight: 700;
120+
}
121+
122+
tr:nth-child(even) td {
123+
background: #fafafa;
124+
}
125+
126+
/* ---- Horizontal rules ---- */
127+
hr {
128+
border: none;
129+
border-top: 1px solid #d1d5db;
130+
margin: 2em 0;
131+
}
132+
133+
/* ---- Images ---- */
134+
img {
135+
max-width: 100%;
136+
height: auto;
137+
}
138+
139+
/* ---- Callout-style blockquotes (podcast tip blocks) ---- */
140+
blockquote p strong:first-child {
141+
display: block;
142+
font-style: normal;
143+
color: #1a1a1a;
144+
}

epub/metadata.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: "GIT Going with GitHub"
3+
subtitle: "A Two-Day Accessible Open Source Workshop"
4+
author: "Community Access"
5+
date: "2026"
6+
lang: en
7+
description: "A comprehensive two-day workshop teaching GitHub fundamentals with a focus on accessibility, screen readers, and inclusive open source participation."
8+
rights: "CC BY 4.0 — Community Access"
9+
toc: true
10+
toc-depth: 2
11+
epub-chapter-level: 1

epub/pdf.css

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
/* GIT Going with GitHub — PDF Stylesheet (WeasyPrint) */
2+
3+
@page {
4+
size: letter;
5+
margin: 2.5cm 2cm 2.5cm 2cm;
6+
@bottom-center {
7+
content: counter(page);
8+
font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
9+
font-size: 0.8em;
10+
color: #6b7280;
11+
}
12+
}
13+
14+
/* ---- Body & typography ---- */
15+
body {
16+
font-family: Georgia, "Times New Roman", serif;
17+
font-size: 11pt;
18+
line-height: 1.7;
19+
color: #1a1a1a;
20+
}
21+
22+
/* ---- Headings ---- */
23+
h1, h2, h3, h4, h5, h6 {
24+
font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
25+
font-weight: 700;
26+
line-height: 1.3;
27+
margin-top: 1.5em;
28+
margin-bottom: 0.5em;
29+
page-break-after: avoid;
30+
}
31+
32+
h1 {
33+
font-size: 20pt;
34+
border-bottom: 2px solid #1a1a1a;
35+
padding-bottom: 0.3em;
36+
page-break-before: always;
37+
}
38+
39+
h1:first-child {
40+
page-break-before: avoid;
41+
}
42+
43+
h2 { font-size: 15pt; }
44+
h3 { font-size: 12pt; }
45+
h4 { font-size: 11pt; font-style: italic; }
46+
47+
/* ---- Paragraphs ---- */
48+
p {
49+
margin-top: 0;
50+
margin-bottom: 0.9em;
51+
orphans: 3;
52+
widows: 3;
53+
}
54+
55+
/* ---- Links ---- */
56+
a {
57+
color: #0550ae;
58+
text-decoration: underline;
59+
}
60+
61+
/* Print URLs after external links */
62+
a[href^="http"]::after {
63+
content: " (" attr(href) ")";
64+
font-size: 0.8em;
65+
color: #6b7280;
66+
word-break: break-all;
67+
}
68+
69+
/* ---- Code ---- */
70+
code, kbd, samp {
71+
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
72+
font-size: 0.88em;
73+
background: #f3f4f6;
74+
padding: 0.1em 0.3em;
75+
border-radius: 3px;
76+
}
77+
78+
pre {
79+
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
80+
font-size: 0.8em;
81+
background: #f3f4f6;
82+
border: 1px solid #d1d5db;
83+
border-radius: 4px;
84+
padding: 0.8em;
85+
white-space: pre-wrap;
86+
word-break: break-word;
87+
page-break-inside: avoid;
88+
}
89+
90+
pre code {
91+
background: none;
92+
padding: 0;
93+
border-radius: 0;
94+
font-size: 1em;
95+
}
96+
97+
/* ---- Blockquotes ---- */
98+
blockquote {
99+
margin: 1em 0 1em 1.5em;
100+
padding-left: 1em;
101+
border-left: 3px solid #9ca3af;
102+
color: #4b5563;
103+
font-style: italic;
104+
}
105+
106+
/* ---- Lists ---- */
107+
ul, ol {
108+
margin: 0.5em 0 0.9em 1.5em;
109+
padding: 0;
110+
}
111+
112+
li {
113+
margin-bottom: 0.3em;
114+
}
115+
116+
/* ---- Tables ---- */
117+
table {
118+
width: 100%;
119+
border-collapse: collapse;
120+
margin: 1em 0;
121+
font-size: 0.88em;
122+
page-break-inside: avoid;
123+
}
124+
125+
th, td {
126+
border: 1px solid #d1d5db;
127+
padding: 0.4em 0.6em;
128+
text-align: left;
129+
vertical-align: top;
130+
}
131+
132+
th {
133+
background: #f3f4f6;
134+
font-weight: 700;
135+
}
136+
137+
tr:nth-child(even) td {
138+
background: #fafafa;
139+
}
140+
141+
/* ---- Horizontal rules ---- */
142+
hr {
143+
border: none;
144+
border-top: 1px solid #d1d5db;
145+
margin: 1.5em 0;
146+
}
147+
148+
/* ---- Images ---- */
149+
img {
150+
max-width: 100%;
151+
height: auto;
152+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.0",
44
"description": "GIT Going with GitHub - Accessible open source workshop by Community Access",
55
"scripts": {
6+
"build:epub": "node scripts/build-epub.js",
67
"build:html": "node scripts/build-html.js",
78
"build:podcasts": "node podcasts/build-bundles.js && node podcasts/generate-site.js",
89
"build:podcast-bundles": "node podcasts/build-bundles.js",

0 commit comments

Comments
 (0)