byteclubfr / todotxt

Todo.txt parser/serializer for node
ISC License
6 stars 4 forks source link

Add support for metadata/Addon-Data (key:value) #1

Open kmindi opened 9 years ago

kmindi commented 9 years ago

There should be generic support for the specified metadata.

Both key and value must consist of non-whitespace characters, which are not colons. Only one colon separates the key and value.

The metadata could be contained in a list in the item like the context/project-arrays:

item.metadata = { 'key':'value', 'key2':'value' }
evanp commented 6 years ago

Can it also support multiple values in the keys as an array? So this:

2018-03-21 Do something tag:foo tag:bar id:doit

would give:

item.metadata = { 'tag': ['foo', 'bar'], 'id': 'doit' }

I can also see a couple of other ways of working with multiple values: just using the last one, or always using an array. I think multiple values is very rare, though.

evanp commented 6 years ago

Should it also have addMetadata(key, value) and removeMetadata(key) ?