Expanding my notetaking system
TODOs and annotations
I need to write a script which searches these files and lists out all the lines beginning with @t [ ], this is what I want TODO items to look like -
@t 01/25/2021 [ ] Do this soon
We can infer the exact date from the file date
@t Monday [ ] Do this soon
@t +2d [ ] Later
@t +1w [ ] Later
Adding a system of classifiers for TODOs (like the one bullet journals use) also seems like a good idea. Something like this -
Moved
@t 01/25/2021 [>] Do this soon
Done
@t 01/25/2021 [x] Do this soon
Frozen
@t 01/25/2021 [f] Do this soon
I'd also like to add some sort of calendar integration, like I mention a date in a file and I can see all of these in one place. Maybe integrate these with calcurse?
@d 01/25/2021 CS Monday Test
The date being in the past is an implicit "done" indicator
@d 01/25/2021 8:30AM CS Monday Test
Expanding and adding more types of annotations should be easy enough.
@i Stitch khruangbin music into one large mp3 file
Done/archived
@ix Stitch khruangbin music into one large mp3 file
Maybe I can add custom highlighting to markdown mode for these. Hmmm. While I'm at it, a custom format for links would be nice too, something like this -
<a href="/2021-01-17_notes.html">notes</a>
I'd love to add a backlink system too, but I'll have to sync my local database to the website for that.
Month/Week/Day Files
Inspired by the Bullet Journal, collect events, TODOs, due dates etc in one file. Since this file will be used for a bunch of other stuff, I'd like to have a system of demarcating generated content, something like -
$$$gen
TODO
[ ] Mow the lawn
[ ] Buy groceries
DEADLINES
[tod] bruh
[5dy] bruh but later
[1wk] bruh but in a week
$$$
Implementation
This is going to need some sort of database - sqlite seems like a good choice. I'll have to index all the files initially, and note down their last-indexed timestamp. Then when the script runs again I can check the last modified time and only search the files that changed since my last index.
I'm pretty sure I'll run into a bunch of problems implementing this, so all of this might not end up manifesting but this looks fairly straightforward right now.
I want to use a nice compiled language like rust or go but mmmy since I'm really bad at programming lmao.
I also want to put these up on a website someday, ideally one that pulls from my Google Drive. This might be a nice Svelte project to work on. Caching is a possible issue, Cloudflare workers maybe?
Implementation Details/Decisions
- All non-dated TODOs by default are dated for today (not in the database, just in the UI).
Nomenclature - adiutor/ad
I'm calling this project adiutor - the Latin word for helper or assistant. I'm going to alias it to ad so I can get to it with as few keystrokes as possible.
Dart
Implementing this in Dart will hopefully get me more comfortable with the language. I'd love to get into mobile dev someday and Flutter is really popular right now. Also Dart seems like the best bridge out of JavaScript and into the world of "real" programming languages.
I was considering Scala, but it felt too "serious". Dart is the perfect balance between a real programming language and a scripting language. Here's a few useful links I found -
CLI Design
Here's what I want the CLI to look like -
adiutor
-f/--frozen Show frozen/postponed
-h/--help Show this help message
-t/--today Show annotations for today
-w/--week Show annotations for the coming week
-m/--month Show annotations for the coming month
-y/--today Show annotations for yesterday
--pw/--past-week Show annotations for the past week
-pm/--past-month Show annotations for the past month
-a/--all Show all annotations
-T/--todos Show only todos
-D/--dates Show only dates
-i/--ideas Show ideas
This is a preliminary draft, I'll obviously add more stuff to this as time goes on.
Processing one file
I'm going to start by processing one file and extracting all the lines which are useful to me. This is basically what I need to do -
- Read the file
- Filter out code (backticks) and $$$gen $$$ blocks
- Get what I want
I've figured out how to read files.
// TODO: use streams
new File('file.txt').readAsString().then((String contents) {
print(contents);
});
Then I can slowly parse each one of them.
2021-02-11 18:08 IST
Using a read stream and going line by line also seems like a good idea, might be more performant too.Pseudocode
lsnotes directory.- For each file -
- See if a previous index exists in the database
- If yes and
lastModified =< lastIndexed, skip - Else, index and add to database
- Output relevant data to stdout
This is a waste of time, I'm just going to use msft todo and move on to something more useful.