config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

jourhead (586B)


      1 #!/usr/bin/awk -f
      2 # Copyright 2021, 2022, 2024 Jacob R. Edwards
      3 # Print Journal Entry Titles
      4 
      5 /^$/ { next }
      6 ! /^\.|^[^:]+:/ { nextfile }
      7 
      8 # groff_ms(7)
      9 /^\.TL$/ {
     10 	do {
     11 		getline
     12 	} while (/^\./) # Skip potential comments
     13 
     14 	# Replace quote strings with ASCII double quote
     15 	if (/\\\*[QU]/)
     16 		gsub("\\\\\\*[QU]", "\"", $0)
     17 
     18 	# Encase superscripts in brackets
     19 	if (/\\\*[{}]/) {
     20 		gsub("\\\\\\*{", "[", $0)
     21 		gsub("\\\\\\*}", "]", $0)
     22 	}
     23 
     24 	print FILENAME, $0
     25 	nextfile
     26 }
     27 
     28 # markdown (apparently MultiMarkdown metadata)
     29 match($0, "title:[ 	]+") {
     30 	print FILENAME, substr($0, RLENGTH + 1)
     31 }