Render the book in PDF using pandoc
and LaTeX.
#122
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CI" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install plugin | |
run: cargo install --path helpers/mdbook-exercise-linker | |
- name: Install mdbook-pandoc and related dependencies | |
run: | | |
cargo install mdbook-pandoc --locked --version 0.7.1 | |
sudo apt-get update | |
sudo apt-get install -y fonts-noto | |
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 - | |
echo "$PWD/pandoc-${PANDOC_VERSION}/bin" >> $GITHUB_PATH | |
shell: bash | |
- name: Setup TeX Live | |
uses: teatimeguest/setup-texlive-action@v3 | |
with: | |
packages: | |
scheme-basic | |
luatex | |
lualatex-math | |
luacolor | |
luatexbase | |
luaotfload | |
framed | |
unicode-math | |
xcolor | |
geometry | |
longtable | |
booktabs | |
array | |
lua-ul | |
etoolbox | |
fancyvrb | |
footnote | |
selnolig | |
natbib | |
csquotes | |
bookmark | |
xurl | |
pgfpages | |
amsmath | |
amssymb | |
setspace | |
iftex | |
textcomp | |
lmodern | |
- name: Check `tlmgr` version | |
run: tlmgr --version | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: mdbook | |
- name: Build book | |
run: | | |
cd book | |
mdbook build | |
- name: Link Checker | |
uses: lycheeverse/lychee-action@v1 | |
with: | |
fail: true | |
args: | | |
--exclude-loopback | |
--exclude-path "/book/book/pdf/src" | |
--require-https | |
--no-progress | |
book/book | |
# Upload the HTML book as an artifact | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: book | |
# When you support multiple formats, the output directory changes | |
# to include the format in its path. | |
path: book/book/html | |
# Upload the PDF book as an artifact | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: paperback | |
path: book/book/pandoc/100-exercises-to-learn-rust.pdf | |
formatter: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dprint/[email protected] |