diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 910714c..9114644 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,3 +12,10 @@ repos: - id: cargo-check - id: clippy args: ["--", "-D", "warnings"] + - repo: local + hooks: + - id: mdbook + name: mdbook + entry: book/generate.sh + language: script + files: ^book/.* diff --git a/book/generate.sh b/book/generate.sh new file mode 100755 index 0000000..1830018 --- /dev/null +++ b/book/generate.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +set -euo pipefail + +cd "$(git rev-parse --show-toplevel)/book" + +cargo run obsidian-src book-src +mdbook build +cp book-src/README.md ../README.md