Add MdBook generation script and precommit hook

This commit is contained in:
Nick Groenen 2020-12-08 01:00:09 +01:00
parent 2edc2e87fb
commit 6de76d9480
No known key found for this signature in database
GPG Key ID: 4F0AD019928AE098
2 changed files with 16 additions and 0 deletions

View File

@ -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/.*

9
book/generate.sh Executable file
View File

@ -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