GithubHelp home page GithubHelp logo

.todo's Introduction

#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.

.todo's People

Contributors

matthewpalmer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.