d2/Makefile
Anmol Sethi b81647e7e3
Add markdown TOC generation using pandoc and shell
See a875763ecc/lib/misc.sh (L28)

The TOC is generated via pandoc and inserted via shell. `<!-- toc -->`
marks the insertion point, the TOC is inserted right below.

I'm using this in utils-go too. We should use it anywhere else we need
TOCs. I'm sure pandoc can handle the frontmatter in d2-docs too.
2022-12-01 09:54:09 -08:00

23 lines
351 B
Makefile

.POSIX:
.PHONY: all
all: fmt gen lint build test
.PHONY: fmt
fmt:
prefix "$@" ./ci/fmt.sh
.PHONY: gen
gen:
prefix "$@" ./ci/gen.sh
.PHONY: lint
lint:
prefix "$@" go vet --composites=false ./...
.PHONY: build
build:
prefix "$@" go build ./...
.PHONY: test
test:
prefix "$@" ./ci/test.sh
.PHONY: race
race:
prefix "$@" ./ci/test.sh --race ./...