thombruce / toodles

✅ A super simple todo app
https://toodles.thombruce.com/
GNU General Public License v3.0
0 stars 0 forks source link

Add tags #64

Closed thombruce closed 1 year ago

thombruce commented 1 year ago

Tags are a little different from +projects or @contexts. Not much more difficult to match, having patterns like \S+:\S+, but the match will represent a key:value pair of which we will need to store both. Tags are unique in that they have a variable key property.

To begin, we'll follow the same pattern as for #51 and #63, but when inserting tags should also store their key.

Following this, Intervals and Tallies should be reworked to behave as tags and inherit some logic from tags. If possible, we should try to infer whether or not a tag is a tally (looks like an integer) or interval (looks like... what? decimal? this could also be monetary value. maybe pattern like 0h00m(00s); the limiting factor is no colons.).

Tallies and intervals being reworked will likely remove their granularity. Hang onto this code; we may reuse it in the future if/when we make Toodles extendible.

thombruce commented 1 year ago

This won't be under consideration too much here, but I have recently thought that tags could be typed like so:

at[time]:1500
hours[duration]:3h00

This is technically permitted by the general rules for a todo.txt document.

Note that compatibility with markdown todo lists is also desirable (parsing from and outputting to). Square and angle-brackets might present issues there.

Visually, I prefer [squareBrackets].