From 9ff2e660cdd6efaa93ee6c3f04930541221d0119 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Mon, 15 Jan 2024 23:18:45 +0100 Subject: [PATCH] Move `pandoc/` folder out of the way The config fragments there are only used in the GitHub actions, so we can stash them way in the `.github/` folder. --- .github/pandoc/README.md | 4 ++++ {pandoc => .github/pandoc}/ja.yaml | 0 {pandoc => .github/pandoc}/ko.yaml | 0 {pandoc => .github/pandoc}/zh-CN.yaml | 0 {pandoc => .github/pandoc}/zh-TW.yaml | 0 .github/workflows/build.sh | 8 ++++++-- 6 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .github/pandoc/README.md rename {pandoc => .github/pandoc}/ja.yaml (100%) rename {pandoc => .github/pandoc}/ko.yaml (100%) rename {pandoc => .github/pandoc}/zh-CN.yaml (100%) rename {pandoc => .github/pandoc}/zh-TW.yaml (100%) diff --git a/.github/pandoc/README.md b/.github/pandoc/README.md new file mode 100644 index 000000000000..2d62263816fd --- /dev/null +++ b/.github/pandoc/README.md @@ -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. diff --git a/pandoc/ja.yaml b/.github/pandoc/ja.yaml similarity index 100% rename from pandoc/ja.yaml rename to .github/pandoc/ja.yaml diff --git a/pandoc/ko.yaml b/.github/pandoc/ko.yaml similarity index 100% rename from pandoc/ko.yaml rename to .github/pandoc/ko.yaml diff --git a/pandoc/zh-CN.yaml b/.github/pandoc/zh-CN.yaml similarity index 100% rename from pandoc/zh-CN.yaml rename to .github/pandoc/zh-CN.yaml diff --git a/pandoc/zh-TW.yaml b/.github/pandoc/zh-TW.yaml similarity index 100% rename from pandoc/zh-TW.yaml rename to .github/pandoc/zh-TW.yaml diff --git a/.github/workflows/build.sh b/.github/workflows/build.sh index 2ee0fae38a8d..8df3cc459c40 100755 --- a/.github/workflows/build.sh +++ b/.github/workflows/build.sh @@ -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::"