diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index dad671e..edc6ec7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,6 +8,7 @@ on: pull_request: paths: - book/** + - docs/** - examples/endpoints_reference.rs - src/endpoints.rs - src/config.rs @@ -46,6 +47,10 @@ jobs: printf '\n.menu-title::after { content: "v%s"; }\n' "$VERSION" >> book/theme/torchio.css grep -q "content: \"v$VERSION\"" book/theme/torchio.css + # the images are in docs/, where the README takes them from, and the pages use the same files + - name: Copy the images next to the pages + run: mkdir -p book/src/images && cp docs/* book/src/images/ + - name: Write the reference of the endpoints from the catalog run: cargo run --locked --example endpoints_reference > book/src/reference.md diff --git a/.gitignore b/.gitignore index 76b3525..b797874 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /.idea /book/book /book/src/reference.md +/book/src/images/ diff --git a/book/src/control-panel.md b/book/src/control-panel.md index c7c5804..4d367e3 100644 --- a/book/src/control-panel.md +++ b/book/src/control-panel.md @@ -6,7 +6,7 @@ docker run -p 3000:3000 -e UI=1 altrdev/torchio:latest ``` -![The torchio control panel: gauges with history for workers, memory, process RSS, disk, descriptors and requests, and a card for each test](https://raw.githubusercontent.com/altrdev/torchio/refs/heads/main/docs/ui.png) +![The torchio control panel: gauges with history for workers, memory, process RSS, disk, descriptors and requests, and a card for each test](images/ui.png) The gauges and their history (the last 60 seconds) come from [`/info`](endpoints.md#info) and [`/metrics`](endpoints.md#metrics), refreshed every second, and the page shows whether `/ready` is answering `200` or `503`. Each card makes the request you see written under its sliders, and the answer goes in the log at the bottom, so it is also a way to learn the API. The history lives in the page: reloading it starts again. diff --git a/book/src/development.md b/book/src/development.md index b8a3538..4bb290e 100644 --- a/book/src/development.md +++ b/book/src/development.md @@ -65,10 +65,11 @@ CI runs them on Linux and macOS with the format check, `clippy` and the document ## The documentation site -The pages are in `book/src`, written in Markdown, and `book/book.toml` and `book/theme` set the title and the colours. The reference of the endpoints is not written by hand: `cargo run --example endpoints_reference > book/src/reference.md` writes it from the catalog that `/help` is built from, so it is always right. With [mdBook](https://rust-lang.github.io/mdBook/) installed: +The pages are in `book/src`, written in Markdown, and `book/book.toml` and `book/theme` set the title and the colours. The images are in `docs/`, where the README takes them from, and the second command below copies them next to the pages. The reference of the endpoints is not written by hand: `cargo run --example endpoints_reference > book/src/reference.md` writes it from the catalog that `/help` is built from, so it is always right. With [mdBook](https://rust-lang.github.io/mdBook/) installed: ``` cargo run --example endpoints_reference > book/src/reference.md +mkdir -p book/src/images && cp docs/* book/src/images/ mdbook serve book --open python3 book/check-links.py book/book # after mdbook build book ``` diff --git a/book/src/images/logo.svg b/book/src/images/logo.svg deleted file mode 100644 index fccea7a..0000000 --- a/book/src/images/logo.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/book/src/images/social-preview.png b/book/src/images/social-preview.png deleted file mode 100644 index fe8bb9f..0000000 Binary files a/book/src/images/social-preview.png and /dev/null differ diff --git a/book/src/introduction.md b/book/src/introduction.md index a858569..6c2fa4d 100644 --- a/book/src/introduction.md +++ b/book/src/introduction.md @@ -5,7 +5,7 @@ *Torchio* is the Italian word for the press that squeezes wine and oil, as in *mettere sotto torchio*: to put under pressure. Put your containers under the press. It began in 2019 as `high-cpu-node`, when it could only burn CPU. -![torchio watch: gradient bars and history of busy workers, held memory, process RSS and held disk, while keys start a memory test, a CPU burn and a leak](https://raw.githubusercontent.com/altrdev/torchio/refs/heads/main/docs/watch.svg) +![torchio watch: gradient bars and history of busy workers, held memory, process RSS and held disk, while keys start a memory test, a CPU burn and a leak](images/watch.svg) This is the documentation of torchio {{#include version.md}}. The changes of each release are in the [changelog](changelog.md).