diff --git a/.github/pandoc/README.md b/.github/pandoc/README.md new file mode 100644 index 00000000..2d622638 --- /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 2ee0fae3..8df3cc45 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::"