#!/usr/bin/env -S awk -f # Create a table of contents for a markdown file. Respects code blocks! # # ARGS (use these with -v[name]=[value] when calling): # int heading : Indenting level for the "highest" heading. DEFAULT = 1 # int table_only : Only print the table of contents. DEFAULT = 0 # # EXAMPLE RUN: # $ table_of_contents_markdown.awk -vtable_only=1 -vheading=2 <