feat(pdf): add pdf download (#399)

Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
pull/400/head
simonsan 1 month ago committed by GitHub
parent 9a69ea655d
commit d96de404c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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

@ -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

@ -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

@ -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]

@ -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

@ -227,6 +227,9 @@
<a href="{{ path_to_root }}print.html" title="Print this book" aria-label="Print this book">
<i id="print-button" class="fa fa-print"></i>
</a>
<a href="{{ path_to_root }}rust-design-patterns.pdf" title="This book as a PDF" aria-label="This book as a PDF">
<i id="open-pdf-button" class="fa fa-download"></i>
</a>
{{/if}}
{{#if git_repository_url}}
<a href="{{git_repository_url}}" title="Git repository" aria-label="Git repository">

Loading…
Cancel
Save