export CARGO_BUILD_JOBS ?= 4
.DEFAULT_GOAL := help
.PHONY: help build release check check-all fmt lint test test-unit test-integration coverage verify demo clean
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN{FS=":.*?## "}{printf " \033[36m%-18s\033[0m %s\n",$$1,$$2}'
build: ## Debug build (default features = pandoc + typst)
cargo build
release:
cargo build --release
check:
cargo check
check-all:
cargo check --no-default-features
cargo check --no-default-features --features pandoc
cargo check --no-default-features --features typst
cargo check
fmt:
cargo fmt
lint:
cargo fmt --check
cargo clippy --all-targets -- -D warnings
test-unit:
cargo test --lib --bins
test-integration:
cargo test --test '*'
test:
cargo test
coverage:
cargo llvm-cov --lcov --output-path lcov.info
cargo llvm-cov report --summary-only
verify: lint check-all test
demo: build
./target/debug/mdcast render tests/golden/cover-deck.md --target html-reveal --out target/demo/cover-deck.html
./target/debug/mdcast render tests/golden/cover-deck.md --target pdf --out target/demo/cover-deck.pdf
clean:
cargo clean