askama/.readthedocs.yaml
René Kijewski 3a83b3ac65 Do not use cargo-quickinstall for now
It seems like cargo-quickinstall had a breach of some sort:
[cargo-quickinstall#441]. As a precautionary measure they wiped many
pre-compiled files. Amongst them mdbook v0.4.52, which we use to build
our book, and cargo-fuzz v0.13.1, which we use for fuzzing.

This PR makes us not use pre-compiled programs, but use `cargo install`
instead.

[cargo-quickinstall#441]: <https://redirect.github.com/cargo-bins/cargo-quickinstall/issues/441>
2025-09-02 14:59:49 +02:00

35 lines
1.7 KiB
YAML

# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
build:
os: ubuntu-lts-latest
tools:
python: "3.12"
commands:
# Install a current version of rust
- asdf install rust 1.88.0
- asdf global rust 1.88.0
# Install mdbook.
- cargo install mdbook
# Generate "book/theme/index.hbs" as "skeleton" of the generated pages.
- PATH=".cargo/bin:$PATH" book/update-theme.py
# Convert the book to HTML.
- $HOME/.cargo/bin/mdbook build book --dest-dir $READTHEDOCS_OUTPUT/html
# Make the ads readable.
- cat book/ethicalads-theme.css >> $READTHEDOCS_OUTPUT/html/css/general.css
# We are done!
- cp book/404.html $READTHEDOCS_OUTPUT/html
# Build and copy the API docs
- cargo install cargo-docs-rs
- mkdir --parents rustdocs/x86_64-unknown-linux-gnu/doc/
- ln --relative --symbolic --no-target-directory rustdocs/x86_64-unknown-linux-gnu/doc rustdocs/doc
- CARGO_BUILD_TARGET_DIR=rustdocs RUSTC_BOOTSTRAP=1 RUSTC_STAGE=1 cargo docs-rs --target x86_64-unknown-linux-gnu --package askama
- CARGO_BUILD_TARGET_DIR=rustdocs RUSTC_BOOTSTRAP=1 RUSTC_STAGE=1 cargo docs-rs --target x86_64-unknown-linux-gnu --package askama_derive
- CARGO_BUILD_TARGET_DIR=rustdocs RUSTC_BOOTSTRAP=1 RUSTC_STAGE=1 cargo docs-rs --target x86_64-unknown-linux-gnu --package askama_escape
- CARGO_BUILD_TARGET_DIR=rustdocs RUSTC_BOOTSTRAP=1 RUSTC_STAGE=1 cargo docs-rs --target x86_64-unknown-linux-gnu --package askama_macros
- CARGO_BUILD_TARGET_DIR=rustdocs RUSTC_BOOTSTRAP=1 RUSTC_STAGE=1 cargo docs-rs --target x86_64-unknown-linux-gnu --package askama_parser
- cp --preserve=all --recursive --target-directory $READTHEDOCS_OUTPUT/html/ rustdocs/x86_64-unknown-linux-gnu/doc/