Skip to content

Commit d9b32a8

Browse files
author
Dmitry Ovsyanko
committed
++
1 parent bbd9415 commit d9b32a8

3 files changed

Lines changed: 26 additions & 6 deletions

File tree

.github/workflows/build-book.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@ jobs:
1414
- name: Checkout (gh-pages)
1515
uses: actions/checkout@v4
1616
with:
17-
ref: gh-pages
17+
ref: main
1818
fetch-depth: 0
1919

20+
- name: Fetch and extract gh-pages into workspace
21+
run: |
22+
git fetch origin gh-pages:gh-pages
23+
git archive gh-pages | tar -x -C .
24+
2025
- name: Setup Node.js
2126
uses: actions/setup-node@v4
2227
with:
@@ -28,8 +33,7 @@ jobs:
2833
sudo apt-get install -y pandoc wkhtmltopdf zip
2934
3035
- name: Install npm deps for scripts
31-
run: |
32-
npm ci --prefix tools || npm install --prefix tools
36+
run: npm install --prefix tools
3337

3438
- name: Build site sources (split markdown + emit toc)
3539
run: |
@@ -47,9 +51,16 @@ jobs:
4751
run: |
4852
pandoc docs/index.md -s --metadata title="The node-xml-toolkit User's Guide" --css=tools/templates/site.css --template=tools/templates/book.html --toc -o build/book.html
4953
50-
- name: Generate PDF with bookmarks
54+
- name: Install XeLaTeX and fonts
55+
run: |
56+
sudo apt-get update
57+
sudo apt-get install -y texlive-xetex fonts-dejavu-core fonts-noto-core
58+
59+
- name: Generate PDF via pandoc + xelatex with a Unicode font
5160
run: |
52-
wkhtmltopdf --print-media-type --outline build/book.html build/book.pdf
61+
pandoc docs/index.md -s --toc -V geometry:margin=1in \
62+
-V mainfont="DejaVu Serif" \
63+
--pdf-engine=xelatex -o build/book.pdf
5364
5465
- name: Package site HTML
5566
run: |

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2397,4 +2397,4 @@ app.post('/soap', async (req, res) => {
23972397
})
23982398
}
23992399
})
2400-
```
2400+
```

tools/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "node-xml-toolkit-tools",
3+
"version": "1.0.0",
4+
"private": true,
5+
"scripts": {
6+
"split": "node split-by-h2.js"
7+
},
8+
"dependencies": {}
9+
}

0 commit comments

Comments
 (0)