From 32d4c11d988fccc61e41361c0ef845c1f66382b9 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Fri, 22 May 2015 01:37:05 -0400 Subject: [PATCH] :Thoughts markdown header level sectioning increase Thoughts are intended to be simple, and h2 is currently used for the date --- tools/mdfmt | 6 ++++-- tools/thoughts-fmt | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/mdfmt b/tools/mdfmt index bca6cec..0a68123 100755 --- a/tools/mdfmt +++ b/tools/mdfmt @@ -20,11 +20,13 @@ ## declare to=html5 +declare -i hlevel=1 -while getopts nP opt; do +while getopts nPh: opt; do case "$opt" in n|P) to=plain;; + h) hlevel="$OPTARG";; esac done -exec pandoc -S -fmarkdown -t"$to" +exec pandoc -S -fmarkdown -t"$to" --base-header-level=$hlevel diff --git a/tools/thoughts-fmt b/tools/thoughts-fmt index d2e1bf7..e55e8be 100755 --- a/tools/thoughts-fmt +++ b/tools/thoughts-fmt @@ -29,8 +29,7 @@ declare -a all_args="$@" while getopts nP opt; do case "$opt" in - n) ;; - P) ;; + n|P) ;; esac done @@ -51,4 +50,4 @@ test "$timestamp" -gt "$md_cutoff" \ || fmt-old # it's just that simple. -exec "$(dirname "$0" )"/mdfmt "${all_args[@]}" +exec "$(dirname "$0" )"/mdfmt -h2 "${all_args[@]}"