Skip to content

Commit f839fc0

Browse files
authored
Merge pull request mainmatter#161 from mainmatter/cover-for-pdf
add cover and back to downloadable pdf
2 parents 0aecb53 + 954dd0f commit f839fc0

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ jobs:
3131
run: cargo install --path helpers/mdbook-exercise-linker
3232
- name: Install link shortener plugin
3333
run: cargo install --path helpers/mdbook-link-shortener
34-
- name: Install mdbook-pandoc, calibre and related dependencies
34+
- name: Install mdbook-pandoc, calibre, pdftk and related dependencies
3535
run: |
3636
cargo install mdbook-pandoc --locked --version 0.7.1
3737
sudo apt-get update
38-
sudo apt-get install -y fonts-noto calibre
38+
sudo apt-get install -y fonts-noto calibre pdftk
3939
4040
export PANDOC_VERSION=3.3
4141
curl -LsSf https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz | tar zxf -
@@ -81,6 +81,10 @@ jobs:
8181
run: |
8282
cd book
8383
mdbook build
84+
- name: Add cover and back to downloadable PDF
85+
run: |
86+
pdftk book/assets/cover.pdf book/book/pandoc/pdf/100-exercises-to-learn-rust.pdf book/assets/back.pdf cat output book/book/pandoc/pdf/100-exercises-to-learn-rust-with-cover.pdf
87+
mv book/book/pandoc/pdf/100-exercises-to-learn-rust-with-cover.pdf book/book/pandoc/pdf/100-exercises-to-learn-rust.pdf
8488
- name: Convert HTML to ePUB
8589
run: |
8690
cd book/book/pandoc/html

book/assets/back.pdf

119 KB
Binary file not shown.

book/assets/cover.pdf

992 KB
Binary file not shown.

0 commit comments

Comments
 (0)