diff --git a/.github/workflows/kanidm_book.yml b/.github/workflows/kanidm_book.yml index 5d3c149e1..b387135f6 100644 --- a/.github/workflows/kanidm_book.yml +++ b/.github/workflows/kanidm_book.yml @@ -26,17 +26,9 @@ jobs: toolchain: stable - uses: actions-rs/cargo@v1 - with: - command: doc - args: --no-deps - - name: Copy developer readme into book - run: cp DEVELOPER_README.md ./kanidm_book/src/ && echo '- [Developer Guide](DEVELOPER_README.md)' >> ./kanidm_book/src/SUMMARY.md - - name: Run mdbook - run: mdbook build kanidm_book - - - name: Move files around - run: mv ./kanidm_book/book/ ./docs/ && mkdir -p ./docs/rustdoc/ && mv ./target/doc/* ./docs/rustdoc/ + - name: Run make book + run: make book - name: Deploy uses: peaceiris/actions-gh-pages@v3 diff --git a/.gitignore b/.gitignore index b48b527ef..a6edbac5c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ todo.sh vendor.tar.* *.patch orca/example_profiles/small/orca-edited.toml +docs/ diff --git a/Makefile b/Makefile index c2b1a10fc..4a104a6f6 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help build/kanidmd build/radiusd test/kanidmd push/kanidmd push/radiusd vendor-prep doc install-tools prep vendor +.PHONY: help build/kanidmd build/radiusd test/kanidmd push/kanidmd push/radiusd vendor-prep doc install-tools prep vendor book clean_book IMAGE_BASE ?= kanidm IMAGE_VERSION ?= devel @@ -6,6 +6,8 @@ EXT_OPTS ?= IMAGE_ARCH ?= "linux/amd64,linux/arm64" ARGS ?= --build-arg "SCCACHE_REDIS=redis://172.24.20.4:6379" +BOOK_VERSION ?= master + .DEFAULT: help help: @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/\n\t/' @@ -70,6 +72,17 @@ doc: ## build doc local doc: cargo doc --document-private-items +book: + cargo doc --no-deps + mdbook build kanidm_book + mv ./kanidm_book/book/ ./docs/ + mkdir -p ./docs/rustdoc/${BOOK_VERSION} + mv ./target/doc/* ./docs/rustdoc/${BOOK_VERSION}/ + +clean_book: + rm -rf ./docs + + install-tools: ## install tools in local environment install-tools: cd kanidm_tools && cargo install --path . --force diff --git a/kanidm_book/src/DEVELOPER_README.md b/kanidm_book/src/DEVELOPER_README.md new file mode 120000 index 000000000..1d4844c40 --- /dev/null +++ b/kanidm_book/src/DEVELOPER_README.md @@ -0,0 +1 @@ +../../DEVELOPER_README.md \ No newline at end of file diff --git a/kanidm_book/src/SUMMARY.md b/kanidm_book/src/SUMMARY.md index 46e4e01e3..926665742 100644 --- a/kanidm_book/src/SUMMARY.md +++ b/kanidm_book/src/SUMMARY.md @@ -20,3 +20,4 @@ - [RADIUS](./radius.md) - [LDAP](./ldap.md) - [Why TLS?](./why_tls.md) +- [Developer Guide](DEVELOPER_README.md) diff --git a/kanidm_book/src/intro.md b/kanidm_book/src/intro.md index 2ae6d5981..d9e513026 100644 --- a/kanidm_book/src/intro.md +++ b/kanidm_book/src/intro.md @@ -15,7 +15,7 @@ The intent of the Kanidm project is to: ## Library documentation -Looking for the `rustdoc` documentation for the libraries themselves? [Click here!](./rustdoc/kanidm/) +Looking for the `rustdoc` documentation for the libraries themselves? [Click here!](./rustdoc/master/kanidm/) ## Why do I want Kanidm?