From d96de404c45f17310c3eb77b4669d715ce923d33 Mon Sep 17 00:00:00 2001 From: simonsan <14062932+simonsan@users.noreply.github.com> Date: Sun, 17 Mar 2024 03:35:42 +0100 Subject: [PATCH] feat(pdf): add pdf download (#399) Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com> --- .env | 1 + .github/workflows/install-mdbook/action.yml | 5 +++-- README.md | 3 +++ book.toml | 2 +- src/intro.md | 5 +++++ theme/index.hbs | 3 +++ 6 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 193c72d..3976745 100644 --- a/.env +++ b/.env @@ -2,3 +2,4 @@ MDBOOK_VERSION=0.4.37 MDBOOK_I18N_HELPERS_VERSION=0.3.2 MDBOOK_PANDOC_VERSION=0.6.0 MDBOOK_LAST_CHANGED_VERSION=0.1.4 +PANDOC_VERSION=3.1.12.2 \ No newline at end of file diff --git a/.github/workflows/install-mdbook/action.yml b/.github/workflows/install-mdbook/action.yml index 6cc6d3b..57a50e2 100644 --- a/.github/workflows/install-mdbook/action.yml +++ b/.github/workflows/install-mdbook/action.yml @@ -40,8 +40,9 @@ runs: - name: Install mdbook-pandoc and related dependencies run: | + . ./.env sudo apt-get update sudo apt-get install -y texlive texlive-latex-extra texlive-luatex texlive-lang-cjk librsvg2-bin fonts-noto - curl -LsSf https://github.com/jgm/pandoc/releases/download/3.1.12.2/pandoc-3.1.12.2-linux-amd64.tar.gz | tar zxf - - echo "$PWD/pandoc-3.1.12.2/bin" >> $GITHUB_PATH + curl -LsSf https://github.com/jgm/pandoc/releases/download/$PANDOC_VERSION/pandoc-$PANDOC_VERSION-linux-amd64.tar.gz | tar zxf - + echo "$PWD/pandoc-$PANDOC_VERSION/bin" >> $GITHUB_PATH shell: bash diff --git a/README.md b/README.md index cdad791..6954c59 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ An open source book about design patterns and idioms in the Rust programming language that you can read [here](https://rust-unofficial.github.io/patterns/). +You can also download the book in PDF format from +[this link](https://rust-unofficial.github.io/patterns/rust-design-patterns.pdf). + ## Contributing You are missing content in this repository that can be helpful for others, and diff --git a/book.toml b/book.toml index a44e064..ab2ea9c 100644 --- a/book.toml +++ b/book.toml @@ -51,7 +51,7 @@ optional = true hosted-html = "https://rust-unofficial.github.io/patterns/" [output.pandoc.profile.pdf] -output-file = "patterns.pdf" +output-file = "rust-design-patterns.pdf" pdf-engine = "lualatex" [output.pandoc.profile.pdf.variables] diff --git a/src/intro.md b/src/intro.md index 1f70e3d..70b648e 100644 --- a/src/intro.md +++ b/src/intro.md @@ -5,6 +5,11 @@ If you are interested in contributing to this book, check out the [contribution guidelines](https://github.com/rust-unofficial/patterns/blob/master/CONTRIBUTING.md). +## 📯 News + +- **2024-03-17**: You can now download the book in PDF format from + [this link](https://rust-unofficial.github.io/patterns/rust-design-patterns.pdf). + ## Design patterns In software development, we often come across problems that share similarities diff --git a/theme/index.hbs b/theme/index.hbs index 30c42d9..58a7ea0 100644 --- a/theme/index.hbs +++ b/theme/index.hbs @@ -227,6 +227,9 @@ + + + {{/if}} {{#if git_repository_url}}