Create TOC for syntax reference

Refraining from applying this to the introduction for now, although I think we'll want to.

This overall approach is a bit clunky - yet another checked-in piece of autogenerated stuff. I'm making "TOC is out of date" a warning.

CC @nickm, although I'm going to merge this as-is.

Merge request reports

Loading
+14 −0
Changes for maint/update-tocs: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@ case "$*" in
    *) echo >&2 'bad usage'; exit 1;;
esac

problems=false

process_file () {
    file=$1
    perl <$file -wne '
@@ -40,8 +42,20 @@ process_file () {
    if $install; then
	mv -f $file.new $file
    else
	set +e
	diff -u $file $file.new
	rc=$?
	set -e
	case $rc in
	    0) ;;
	    1) problems=true ;;
	    *) exit $rc ;;
	esac
    fi
}

process_file doc/template-syntax.md

if $problems; then
    echo 'Documentation TOC mismatch - rerun maint/update-tocs'
fi
Loading