commit b8c01a723b59e4cd5390fb98d11af982b390e6cc
parent a9c9a198a6c519d689c7534ccf3d32746571841c
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Sat, 5 Oct 2024 21:34:26 -0700
Update jourhead to script support older markdown files
Before using groff_ms(7) I was using markdown with a metadata block
at the beginning. This change adds support for the markdown format.
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/local/bin/bin/jourhead b/local/bin/bin/jourhead
@@ -1,10 +1,11 @@
#!/usr/bin/awk -f
-# Copyright 2021, 2022 Jacob R. Edwards
+# Copyright 2021, 2022, 2024 Jacob R. Edwards
# Print Journal Entry Titles
/^$/ { next }
-! /^\./ { nextfile }
+! /^\.|^[^:]+:/ { nextfile }
+# groff_ms(7)
/^\.TL$/ {
do {
getline
@@ -23,3 +24,8 @@
print FILENAME, $0
nextfile
}
+
+# markdown (apparently MultiMarkdown metadata)
+match($0, "title:[ ]+") {
+ print FILENAME, substr($0, RLENGTH + 1)
+}