Skip to content

Commit

Permalink
Move pandoc/ folder out of the way (#1704)
Browse files Browse the repository at this point in the history
The config fragments there are only used in the GitHub actions, so we
can stash them way in the `.github/` folder.
  • Loading branch information
mgeisler authored Jan 17, 2024
1 parent 312e151 commit d731da4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/pandoc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Config Overrides for `mdbook-pandoc`

The configuration file fragments here are used to override the configuration in
`book.toml`. See `.github/workflows/build.sh` for details.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions .github/workflows/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ else
export MDBOOK_OUTPUT__HTML__REDIRECT='{}'

# Include language-specific Pandoc configuration
[ -f "pandoc/$book_lang.yaml" ] && export MDBOOK_OUTPUT__PANDOC__PROFILE__PDF__DEFAULTS="pandoc/$book_lang.yaml"
if [ -f ".github/pandoc/$book_lang.yaml" ]; then
export MDBOOK_OUTPUT__PANDOC__PROFILE__PDF__DEFAULTS=".github/pandoc/$book_lang.yaml"
fi
fi

mdbook build -d "$dest_dir"
[ -f "$dest_dir/pandoc/pdf/comprehensive-rust.pdf" ] && mv "$dest_dir/pandoc/pdf/comprehensive-rust.pdf" "$dest_dir/html/"
if [ -f "$dest_dir/pandoc/pdf/comprehensive-rust.pdf" ]; then
mv "$dest_dir/pandoc/pdf/comprehensive-rust.pdf" "$dest_dir/html/"
fi
(cd "$dest_dir/exerciser" && zip --recurse-paths ../html/comprehensive-rust-exercises.zip comprehensive-rust-exercises/)

echo "::endgroup::"

0 comments on commit d731da4

Please sign in to comment.