add cover and back to downloadable pdf
authorMarco Otte-Witte <marco.otte-witte@mainmatter.com>
Wed, 2 Oct 2024 13:47:57 +0000 (15:47 +0200)
committerMarco Otte-Witte <marco.otte-witte@mainmatter.com>
Wed, 2 Oct 2024 14:00:32 +0000 (16:00 +0200)
.github/workflows/ci.yml
book/assets/back.pdf [new file with mode: 0644]
book/assets/cover.pdf [new file with mode: 0644]

index 48d315d..c80f76d 100644 (file)
@@ -31,11 +31,11 @@ jobs:
         run: cargo install --path helpers/mdbook-exercise-linker
       - name: Install link shortener plugin
         run: cargo install --path helpers/mdbook-link-shortener
-      - name: Install mdbook-pandoc, calibre and related dependencies
+      - name: Install mdbook-pandoc, calibre, pdftk and related dependencies
         run: |
           cargo install mdbook-pandoc --locked --version 0.7.1
           sudo apt-get update
-          sudo apt-get install -y fonts-noto calibre
+          sudo apt-get install -y fonts-noto calibre pdftk
           
           export PANDOC_VERSION=3.3
           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:
         run: |
           cd book
           mdbook build
+      - name: Add cover and back to downloadable PDF
+        run: |
+          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
+          mv book/book/pandoc/pdf/100-exercises-to-learn-rust-with-cover.pdf book/book/pandoc/pdf/100-exercises-to-learn-rust.pdf
       - name: Convert HTML to ePUB
         run: |
           cd book/book/pandoc/html
diff --git a/book/assets/back.pdf b/book/assets/back.pdf
new file mode 100644 (file)
index 0000000..e4e67da
Binary files /dev/null and b/book/assets/back.pdf differ
diff --git a/book/assets/cover.pdf b/book/assets/cover.pdf
new file mode 100644 (file)
index 0000000..3109e69
Binary files /dev/null and b/book/assets/cover.pdf differ