First published: 2016-05-21. Last updated: 2016-05-21

Shell commands to ease the manual creation of table of contents

$ grep -E '^\#+{2}' $fpath | sed -e 's/#* //' -e 's/ /-/g' -e 's/\(.*\)/\L\1/' -e 's+/+-+g' -e 's/^/#/'
$ grep -E '^\#+{2}' $fpath | sed -e 's/#* //' -e 's/^/\[/' -e 's/$/\]\(/'

For comments in plain Markdown and in Jekyll, use XML comments

      <li>Very important text</li>

For VIM modeline, use XML comments too. The closing comment tag must not be in the same line as the modeline, otherwise VIM will try to parse it too and fail.

<!--- vim: ft=markdown