mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
da562ad74c
Gets rid of `doc/README.mdtoc` and its build script. Since GitHub.com renders anchors for each heading, all we have to do is put a simple table of contents into `README.md` itself, and everything will get linked up nicely. Pros of this approach: * We don't have to point out to people not to edit `README.md` anymore * We don't have to run the build script each time README gets edited Cons of this change: * The "chapter" numbers are lost. They were silly anyway. `doc/mdtoc` renders a Markdown table of contents for a Markdown file. `doc/filter-toc` filters that down to only headings after ToC. This script can be used to easily insert ToC into the current document when editing `README.md` with, e.g., Vim: :read !doc/filter-toc %
4 lines
191 B
Bash
Executable file
4 lines
191 B
Bash
Executable file
#!/bin/bash
|
|
# Render Markdown ToC with only headings appearing after "Table of Contents"
|
|
dir="$(dirname "$0")"
|
|
"$dir"/mdtoc "$1" | sed -n '/table-of-contents/,$p' | grep -v table-of-contents
|