Logo
Explore Help
Sign In
Mirrors/pyenv
1
0
Fork 0
You've already forked pyenv
mirror of https://github.com/pyenv/pyenv.git synced 2026-02-07 03:07:36 +09:00
Code Issues Packages Projects Releases Wiki Activity
pyenv/doc/filter-toc

5 lines
191 B
Plaintext
Raw Normal View History

replace build system with generated table of contents 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 %
2012-12-12 02:43:48 +01:00
#!/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
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.7 Page: 26ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API