forked from dusk-network/plonk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
24 lines (19 loc) · 1.36 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
REPO_NAME := $(shell git config --get-regexp remote.origin.url | sed "s/.*dusk-network\/\(.*\)\.git/\1/")
PACKAGE_NAME := $(shell cargo metadata --no-deps --format-version=1 | python -c "import sys, json; print json.load(sys.stdin)['packages'][0]['name']")
REPO_BADGE_URL := "https://img.shields.io/badge/github-$(shell echo $(REPO_NAME) | sed "s/-/--/g")-brightgreen?logo=github"
META := "<meta http-equiv=refresh content=0;url=./$(shell echo $(PACKAGE_NAME) | sed "s/-/_/g")/index.html>"
define generate_docs
@echo $(META) > target/doc/index.html && \
curl -o 'target/doc/badge.svg' 'https://img.shields.io/badge/docs-latest-blue?logo=rust' && \
curl -o 'target/doc/repo-badge.svg' $(REPO_BADGE_URL) && \
curl -L https://github.com/davisp/ghp-import/archive/master.tar.gz | tar --strip-components 1 -C $1 -xz
$1/ghp_import.py -n target/doc
rm -rf $1
endef
help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
doc: ## Generate documentation
@cargo rustdoc --features nightly --lib -- --html-in-header docs/katex-header.html
doc-internal: ## Generate documentation with private items
@cargo rustdoc --features nightly --lib -- --document-private-items -- --html-in-header docs/katex-header.html --document-private-items
.PHONY: help doc doc-internal publish-doc