Skip to content

Commit

Permalink
Merge pull request #108 from godot-rust/feature/admonish
Browse files Browse the repository at this point in the history
mdbook-admonish
  • Loading branch information
Bromeon authored Jul 30, 2023
2 parents 5d4bb1d + a774d21 commit 7a20e87
Show file tree
Hide file tree
Showing 12 changed files with 486 additions and 69 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ on:
env:
# Use fixed versions for now, replace with 'latest' to auto-use latest
# Note: during build, there's a warning when using mdbook-toc compiled against an older mdbook version, should work though.
MDBOOK_VERSION: "0.4.14"
MDBOOK_TOC_VERSION: "0.7.0"
MDBOOK_VERSION: "0.4.32"
MDBOOK_TOC_VERSION: "0.13.0"
MDBOOK_ADMONISH_VERSION: "1.10.1"
MDBOOK_BIN: "/tmp/mdbook-bin"

jobs:
Expand All @@ -25,15 +26,20 @@ jobs:
# Note: actions-rs/[email protected] was considered, but a full 'cargo install' is unnecessarily slow and the cache mechanism is not reliable
# (error "Unable to download mdbook == 0.4.14 from the tool cache: Error: Unexpected HTTP response: 403")
# So, directly pull the release from GitHub
- name: "Install mdbook + mdbook-toc"
- name: "Install mdbook, mdbook-toc, mdbook-admonish"
run: |
wget https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz -O /tmp/mdbook.tar.gz
wget https://github.com/badboy/mdbook-toc/releases/download/${MDBOOK_TOC_VERSION}/mdbook-toc-${MDBOOK_TOC_VERSION}-x86_64-unknown-linux-gnu.tar.gz -O /tmp/mdbook-toc.tar.gz
wget https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz \
-O /tmp/mdbook.tar.gz
wget https://github.com/badboy/mdbook-toc/releases/download/${MDBOOK_TOC_VERSION}/mdbook-toc-${MDBOOK_TOC_VERSION}-x86_64-unknown-linux-gnu.tar.gz \
-O /tmp/mdbook-toc.tar.gz
wget https://github.com/tommilligan/mdbook-admonish/releases/download/${MDBOOK_ADMONISH_VERSION}/mdbook-admonish-v${MDBOOK_ADMONISH_VERSION}-x86_64-unknown-linux-gnu.tar.gz
-O /tmp/mdbook-admonish.tar.gz
mkdir ${MDBOOK_BIN}
echo ${MDBOOK_BIN} >> $GITHUB_PATH
tar -xvzf /tmp/mdbook.tar.gz -C ${MDBOOK_BIN}
tar -xvzf /tmp/mdbook-toc.tar.gz -C ${MDBOOK_BIN}
tar -xvzf /tmp/mdbook-admonish.tar.gz -C ${MDBOOK_BIN}
- name: "Build book"
run: mdbook build
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ The godot-rust book is a user guide for the Rust bindings. The book is still wor

An online version of the book is available at [godot-rust.github.io/book][book-web].

The book is built with [mdBook] and the plugin [mdbook-toc]. To install them and build the book locally, you can run:
The book is built with [mdBook] and the plugins [mdbook-toc] and [mdbook-admonish]. To install them and build the book locally, you can run:
```bash
$ cargo install mdbook mdbook-toc
$ cargo install mdbook mdbook-toc mdbook-admonish
$ mdbook build
```

Expand All @@ -30,6 +30,7 @@ Any contribution intentionally submitted for inclusion in the work by you shall
[book-web]: https://godot-rust.github.io/book
[mdBook]: https://github.com/rust-lang-nursery/mdBook
[mdbook-toc]: https://github.com/badboy/mdbook-toc
[mdbook-admonish]: https://github.com/tommilligan/mdbook-admonish
[Godot 3]: https://github.com/godot-rust/gdnative
[Godot 4]: https://github.com/godot-rust/gdext
[MIT license]: LICENSE.md
5 changes: 5 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ max-level = 3
command = "mdbook-toc"
renderer = ["html"]

[preprocessor.admonish]
command = "mdbook-admonish"
assets_version = "2.0.2" # do not edit: managed by `mdbook-admonish install`

[output.html]
git-repository-url = "https://github.com/godot-rust/book"
additional-css = ["config/mdbook-admonish.css"]

[output.html.redirect]
"introduction.html" = "gdnative"
Expand Down
Loading

0 comments on commit 7a20e87

Please sign in to comment.