d2/ci/fmt.sh
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

7 lines
131 B
Bash
Executable file

#!/bin/sh
set -eu
. "$(dirname "$0")/sub/lib.sh"
cd -- "$(dirname "$0")/.."
sh_c tocsubst --skip 1 README.md
./ci/sub/fmt/make.sh