Skip to content

Commit 0144bc5

Browse files
committed
Build the book PDF.
Content is still missing, but we need to get the CI prepped.
1 parent efca24f commit 0144bc5

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

.github/workflows/jekyll-gh-pages.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,22 @@ jobs:
113113
--offline --include-fragments
114114
--root-dir docs/_site-pdf
115115
docs/_site-pdf/book.html
116+
- name: Set up Node.js
117+
uses: actions/setup-node@v4
118+
with:
119+
node-version: '22'
120+
cache: 'npm'
121+
cache-dependency-path: docs/package-lock.json
122+
- name: Install Node.js dependencies and Chromium
123+
run: |
124+
npm ci
125+
npx puppeteer browsers install chrome --install-deps
126+
working-directory: ./docs
127+
- name: Render book PDF
128+
run: |
129+
mkdir -p _pdf
130+
node render-book.mjs _site-pdf/book.html -o _pdf/book.pdf --outline-tags h1,h2,h3,h4 --additional-script ../perf/detach-pages.js
131+
working-directory: ./docs
116132
- name: Upload Pages artifact
117133
uses: actions/upload-pages-artifact@v5
118134
with:
@@ -141,6 +157,11 @@ jobs:
141157
# Workflow-internal hand-off to the release job; the
142158
# release itself carries the long-lived copy of the zip.
143159
retention-days: 7
160+
- name: Upload book PDF workflow artifact
161+
uses: actions/upload-artifact@v4
162+
with:
163+
name: twinbasic-docs-book-pdf
164+
path: ./docs/_pdf/book.pdf
144165

145166
# Deployment job
146167
deploy:
@@ -173,6 +194,10 @@ jobs:
173194
uses: actions/download-artifact@v4
174195
with:
175196
name: twinbasic-docs-offline-zip
197+
- name: Download book PDF workflow artifact
198+
uses: actions/download-artifact@v4
199+
with:
200+
name: twinbasic-docs-book-pdf
176201
- name: Compute release tag and name
177202
id: tag
178203
env:
@@ -198,7 +223,11 @@ jobs:
198223
199224
**Offline copy:** download `twinbasic-docs-offline.zip`, extract anywhere, and open `index.html` in any browser — no server required. URLs, navigation, dark mode, and search all work over `file://`.
200225
226+
**PDF book:** download `book.pdf` for an offline-readable, printable copy of the full reference.
227+
201228
Source commit: ${{ github.sha }}.
202-
files: twinbasic-docs-offline.zip
229+
files: |
230+
twinbasic-docs-offline.zip
231+
book.pdf
203232
fail_on_unmatched_files: true
204233
make_latest: 'true'

docs/render-book.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ const browser = await puppeteer.launch({
100100
// automatically in ChromeLauncher.defaultArgs(), so we don't repeat
101101
// them here.
102102
args: [
103+
'--no-sandbox',
103104
'--disable-dev-shm-usage',
104105
'--allow-file-access-from-files',
105106
],

0 commit comments

Comments
 (0)