diff --git a/Makefile b/Makefile
index d4241d86f..fdc039a33 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ all: fmt gen lint build test
.PHONY: fmt
fmt:
- prefix "$@" ./ci/sub/fmt/make.sh
+ prefix "$@" ./ci/fmt.sh
.PHONY: gen
gen:
prefix "$@" ./ci/gen.sh
diff --git a/README.md b/README.md
index 6773c6d83..2bb844ccf 100644
--- a/README.md
+++ b/README.md
@@ -19,27 +19,24 @@
# Table of Contents
-
-- [What does D2 look like?](#what-does-d2-look-like)
-- [Quickstart](#quickstart)
-- [Install](#install)
-- [D2 as a library](#d2-as-a-library)
-- [Themes](#themes)
-- [Fonts](#fonts)
-- [Export file types](#export-file-types)
-- [Language tooling](#language-tooling)
-- [Plugins](#plugins)
-- [Comparison](#comparison)
-- [Contributing](#contributing)
-- [License](#license)
-- [Related](#related)
- * [VSCode extension](#vscode-extension)
- * [Vim extension](#vim-extension)
- * [Language docs](#language-docs)
- * [Misc](#misc)
-- [FAQ](#faq)
-
-
+- What does D2 look like?
+- Quickstart
+- Install
+- D2 as a library
+- Themes
+- Fonts
+- Export file types
+- Language tooling
+- Plugins
+- Comparison
+- Contributing
+- License
+- Related
+ - VSCode extension
+ - Vim extension
+ - Language docs
+ - Misc
+- FAQ
## What does D2 look like?
diff --git a/ci/fmt.sh b/ci/fmt.sh
new file mode 100755
index 000000000..04038462d
--- /dev/null
+++ b/ci/fmt.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -eu
+. "$(dirname "$0")/sub/lib.sh"
+cd -- "$(dirname "$0")/.."
+
+sh_c tocsubst --skip 1 README.md
+./ci/sub/fmt/make.sh