Skip to content

todo.txt syntax should include a "comment rule" #1

@karbassi

Description

@karbassi

From @polvoazul on September 27, 2016 6:17

I thing we should be able to add lines to todo.txt that are not going to be parsed as a task.
There are two main advantages to that:

  1. This could be used to write comments, that could range from simple file section separators to editor (such as VIM) hints.
  2. We could use these comments to store non-task data such as a list of projects, or saved filters, or anything else the imagination wants. It would be easy to extend the format by using this.

I suggest the following syntax:

Any line starting with "# " is a comment, and should not be treated as a task. It should not count towards task numbers and should be, by default, ignored by the clients.
Each comment can also have a tag, that must be written like this # {tag}:. This tag means that specific clients can take advantage of that comment to provide additional functionality. A suggestion of a tag would be proj, such that we could drop a line in our todo.txt:

# proj: +buyGuitar +researchNewMusic ...

and tools could keep this projects 'alive' even without any tasks assigned to them.

Something like:

# filter: arts="+music OR +art OR +buyGuitar"

could be used by a client to save a named filter. Possibilities are endless!

I suggest tags are kept very small to keep things uncluttered.
Clients that don't understand a tag must simply discard that line as a comment.

I think todo.txt format is great, but it lacks a little bit of flexibility and I think this extension would enable clients to implement features without breaking other clients!

What do you guys think?

Copied from original issue: todotxt/todo.txt-cli#190

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions