From 62aeb1a0fb0a239f6193b7cb872787578480082c Mon Sep 17 00:00:00 2001 From: JP Appel Date: Tue, 5 Aug 2025 12:03:32 -0400 Subject: Add header parsing and improved link parsing --- cmd/index.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/index.go b/cmd/index.go index f3fa23f..5183870 100644 --- a/cmd/index.go +++ b/cmd/index.go @@ -21,12 +21,17 @@ type IndexFlags struct { func SetupIndexFlags(args []string, fs *flag.FlagSet, flags *IndexFlags) { flags.ParseLinks = true flags.ParseMeta = true + flags.ParseHeadings = true fs.BoolVar(&flags.IgnoreDateError, "ignoreBadDates", false, "ignore malformed dates while indexing") fs.BoolVar(&flags.IgnoreMetaError, "ignoreMetaError", false, "ignore errors while parsing general YAML header info") fs.BoolFunc("ignoreMeta", "only parse title, authors, date, tags from YAML headers", func(s string) error { flags.ParseMeta = false return nil }) + fs.BoolFunc("ignoreHeadings", "don't parse file contents for section headings", func(s string) error { + flags.ParseHeadings = false + return nil + }) fs.BoolFunc("ignoreLinks", "don't parse file contents for links", func(s string) error { flags.ParseLinks = false return nil @@ -126,6 +131,3 @@ func RunIndex(gFlags GlobalFlags, iFlags IndexFlags, db *data.Query) byte { return 0 } - -func init() { -} -- cgit v1.2.3