Add readthedocs configuration and update mdbook

This commit is contained in:
Niklas Mohrin 2026-08-13 01:28:18 +02:00
commit eb0c2345a9
No known key found for this signature in database
GPG key ID: 0ACD89A5C1DEB3EB
4 changed files with 18 additions and 7 deletions

View file

@ -71,10 +71,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: '0.4.4'
- run: ./scripts/get-mdbook.sh
- name: Setup toolchain
uses: dtolnay/rust-toolchain@master
with:
@ -82,7 +79,7 @@ jobs:
- name: Build
run: cargo build
- name: Ensure that docs can be built
run: cd docs && mdbook build
run: ./mdbook build docs
- name: Generate usage string
run: cargo run -- --help > docs/src/usage-actual.txt
- name: Ensure that usage string is up to date

7
.readthedocs.yaml Normal file
View file

@ -0,0 +1,7 @@
version: 2
build:
os: ubuntu-26.04
commands:
- ./scripts/get-mdbook.sh
- ./mdbook build docs --dest-dir $READTHEDOCS_OUTPUT/html

View file

@ -1,6 +1,5 @@
[book]
authors = ["Danilo Bargen"]
authors = ["Danilo Bargen", "Niklas Mohrin"]
language = "en"
multilingual = false
src = "src"
title = "Tealdeer User Manual"

8
scripts/get-mdbook.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
set -ex
wget -O mdbook.tar.gz https://github.com/rust-lang/mdBook/releases/download/v0.5.4/mdbook-v0.5.4-x86_64-unknown-linux-musl.tar.gz
echo "5222beabd3e37dc5be0d18ff99b79058469354db5c220153a1b92db5ba12be89 mdbook.tar.gz" > sha256sums
sha256sum --check sha256sums
tar xvf mdbook.tar.gz