todotxt / todo.txt

‼️ A complete primer on the whys and hows of todo.txt.
GNU General Public License v3.0
2.33k stars 102 forks source link

Storing configuration options inside todo.txt file #29

Closed xuhcc closed 3 years ago

xuhcc commented 4 years ago

I'm looking for a way to store some configuration options in todo.txt file itself.

Several apps already have support for the h tag, so I think that we can use hidden tasks to define configuration options while maintaining compatibility with the current todo.txt v1 specification. For example, here's how options could be defined using the config tag:

// With JSON-like option format
h:1 config:{"title":"myTodoFile"}
h:1 config:{"colored-projects":{"project1":"#eee","project2":"#ccc"}}

// Or INI-like option format
h:1 config:title=myTodoFile
h:1 config:colored-projects=project1,#eee;project2,#ccc

Is there any todo.txt app that follows this approach?

pablito1755 commented 4 years ago

Why not simply define a new standalone standard configuration file which would live in the same folder as todo.txt, done.txt, etc.? I think this may have been mentioned in one of the other issue threads.

xuhcc commented 4 years ago

Yes, standalone config file is a good approach (for example todo.txt CLI already has its own config format). But I would prefer to put everything in a single file as it is more appropriate for the mobile app I'm building.

TangentFoxy commented 4 years ago

@xuhcc The doc you linked to simply calls h configurable. What is the purpose of the 1 in your example? Is it just "a value" to be used with key:value style tags?

xuhcc commented 4 years ago

@TangentFoxy Yes, it's a value. For example, simpletask supports this notation.