Skip to content

[Todo.txt](http://todotxt.com/) file format parser in Rust

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

kstep/todotxt.rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo.txt file format parser

This is a todo.txt file format parser. The format was proposed by Gina Trapani. This parser supports some custom tags:

  • Due date (due:YYYY-MM-DD).
  • Threshold date (t:YYYY-MM-DD).
  • Recurrent tasks (rec:+?[0-9]+[dbmy]).

It also parses all @contexts and +projects. Also, it additionally parses #hashtags.

Usage is very simple. First add it to your Cargo.toml:

[dependencies]
todotxt = "^0.3"

Then use it:

extern crate todotxt;

use todotxt::Task;
use std::fs::File;
use std::io::prelude::*;
use std::io::BufReader;

fn main() {
    let mut todo_file = BufReader::new(File::open("/home/kstep/todo/todo.txt").unwrap());
    for line in todo_file.lines() {
        let todo_item: Task = line.unwrap().parse().unwrap();
        // Now work with Task
    }
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

[Todo.txt](http://todotxt.com/) file format parser in Rust

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages