diff options
-rw-r--r-- | awk/index.awk | 12 | ||||
-rw-r--r-- | org-fc-awk.el | 3 |
2 files changed, 13 insertions, 2 deletions
diff --git a/awk/index.awk b/awk/index.awk index f037bf6..99b0ec7 100644 --- a/awk/index.awk +++ b/awk/index.awk @@ -29,6 +29,7 @@ BEGIN { BEGINFILE { # Reset filetags delete parent_tags; + file_title = ""; parent_tags[0] = ""; state = state_file; @@ -43,7 +44,7 @@ ENDFILE { } } -## Filetags +## File Tags match($0, /#\+FILETAGS:[ \t]+(.*)/, a) { # Combine tags to handle multiple FILETAGS lines @@ -51,6 +52,14 @@ match($0, /#\+FILETAGS:[ \t]+(.*)/, a) { next; } +## File Title + +match($0, /#\+TITLE:[ \t]+(.*)/, a) { + # Combine tags to handle multiple FILETAGS lines + file_title = a[1] + next; +} + ## Heading Parsing match($0, /^(\*+)[ \t]+(.*)$/, a) { @@ -106,6 +115,7 @@ $0 ~ review_data_drawer { if (file_needs_opening) { print " (" \ ":path " escape_string(FILENAME) \ + " :title " (file_title ? escape_string(file_title) : "nil") \ " :cards ("; file_needs_opening = 0; file_needs_closing = 1; diff --git a/org-fc-awk.el b/org-fc-awk.el index 07c64cb..70dcae6 100644 --- a/org-fc-awk.el +++ b/org-fc-awk.el @@ -83,7 +83,8 @@ ITAGS and LTAGS are strings `\":tag1:tag2:\"'" (lambda (file) (mapcar (lambda (card) - (plist-put card :path (plist-get file :path))) + (plist-put card :path (plist-get file :path)) + (plist-put card :filetitle (plist-get file :title))) (plist-get file :cards))) index)) |