Skip to content
/ .todo Public
forked from matthewpalmer/.todo

.todo is a text-based formatting/markdown language for todo lists.

Notifications You must be signed in to change notification settings

bgridley/.todo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

#Why Todo lists should not be locked in to a single platform or service; todo lists should be open and editable across all apps, devices and computers. With .todo files, you can have a single list used across various applications on all of your devices. Edit with a text editor, iPhone, PC, Android or Mac app - what you use to edit doesn't matter. .todo files can be stored just like text files.

#What .todo files are just like text files; you can edit them in a text editor, web browser, or smartphone app.

#How Just create a file called filename.todo, format it properly and you have a .todo file. Set your default apps or text editor for editing this file, and off you go. Download apps compatible with .todo files for desktop and smartphone if any are ever made.

#Syntax .todo files are formatted a lot like Task Lists in Github Flavoured Markdown.

- [] a task list item
- [] list _syntax_ required
- [] normal **formatting**
-[x]more relaxed about syntax than GFM
- [x]so inconsistencies should be ok
- [] incomplete
- [x] completed

What's important is that the first characters in each line are - (list), then an optional space , then [, then optionally x, then ], then the actual todo content.

Regex

I'm terrible at Regular Expressions (so please submit a pull request), but this is one way of handling the parsing.

^-(\s|)\[(x|)\](\s|).*$

in JavaScript

/^-(\s|)\[(x|)\](\s|).*$/gi

A test case, with this regex

- [x] completed           #true
-[] not completed         #true
-[x] another completed    #true
- [] incomplete           #true
- invalid result          #false
not even existing         #false
-[x]condensed             #true
-[]ultra                  #true

Conversion

It's also good to be able to convert a set of todos to a .json object

- [] todo item one
- [x] completed item

=>

[
  {
    "task": "todo item one",
    "completed": false
  },
  {
    "task": "completed item",
    "completed": true
  }
]

Example/Todo

See todo.todo for both an example of a .todo file and a list of things that need to be done for this repository.

About

.todo is a text-based formatting/markdown language for todo lists.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published