Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move pandoc/ folder out of the way #1704

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines +40 to +42
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@max-heller, I wanted to ask about this but forgot: when would the PDF not exist?

When build.sh is run in CI, the mdbook-pandoc plugin should always be installed and so the PDF should always exist, no?

If that's true, then I would like to remove the conditional.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is only ever called from the CI job with mdbook-pandoc installed then yes, it should always exist (unless the build fails, which will abort the script before reaching this check)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, then I'll take it out for now: #1713. I have toyed with the idea of suggesting to people to use build.sh for local development, but for now it's only used in CI.

@sakex has been working on a new mdbook output format which would build all translations in one go: google/mdbook-i18n-helpers#84. That would need to learn the logic of build.sh and then this could become the suggest way for people to build things locally.

(cd "$dest_dir/exerciser" && zip --recurse-paths ../html/comprehensive-rust-exercises.zip comprehensive-rust-exercises/)

echo "::endgroup::"
Loading