MkDocsでページを跨って連番を割り当てる
以前にMkDocsで自動的に見出しへ連番を割り当てるというメモを書きました。これ以外にもMkDocsにmkdocs-enumerate-headings-pluginを追加すると見出しに連番を割り当てることができます。しかも同じページ内だけではなく、異なるページも加味した上で連番を割り当てることができます。GitHubのFeaturesには以下の記載があります。
- Automatically number all headings and (optionally) give each page an sequential chapter number
- Great for writing (technical) reports
- Compatible with plugins like awesome-pages and monorepo
- Compatible with markdown_extensions like pymdownx.snippets
- Compatible with themes like mkdocs-material
- Easy to customize styling through CSS
今回はこのプラグインを実際に試してみます。