Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMike Gerwitz <mtg@gnu.org>2015-05-22 01:37:05 -0400
committerMike Gerwitz <mtg@gnu.org>2015-05-22 01:37:14 -0400
commit32d4c11d988fccc61e41361c0ef845c1f66382b9 (patch)
treead35622194981af02169f92565663016a34867d4 /tools
parent6527ab69980bb9c1b4aa773273cc8b8364fae2ce (diff)
downloadthoughts-32d4c11d988fccc61e41361c0ef845c1f66382b9.tar.gz
thoughts-32d4c11d988fccc61e41361c0ef845c1f66382b9.tar.bz2
thoughts-32d4c11d988fccc61e41361c0ef845c1f66382b9.zip
:Thoughts markdown header level sectioning increase
Thoughts are intended to be simple, and h2 is currently used for the date
Diffstat (limited to 'tools')
-rwxr-xr-xtools/mdfmt6
-rwxr-xr-xtools/thoughts-fmt5
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[@]}"