Date Collator is a Lua script built for the iOS app Trunk Notes.
Opens a specific file with dates on each line (e.g. from a journal).
Uses the current date (month and day), collates all the lines into one file, displays this text.
So you have three pieces:
- the journal text file
- the Lua script
- the page to display the output of the script
These pieces we'll name:
- journal.txt
- date_collator.lua
- date_events.txt
The file journal.txt needs to start with the date and have each entry on one line. Look at journal.txt to see an example.
Copy the date_collator.lua file into Trunk Notes. (note: The current version of Trunk Notes may have a bug where date_collator needs to end with .txt instead of .lua)
Copy date_events.txt into Trunk Notes, or paste this line into a page of your choosing:
{{lua date_collator.lua, journal.txt, start_year}}
Put in the start_year that you want.
The script will collate until reaching the current year.
Going to date_events.txt will load the script, run it on your journal, and output the text to the page.
- allow entries to be over multiple lines, where it starts at one date and then ends right before another (\nYYYY-MM-DD), for example
- add features