Crates.io | todotxt |
lib.rs | todotxt |
version | 0.3.0 |
source | src |
created_at | 2016-03-30 10:48:20.472339 |
updated_at | 2016-03-31 09:17:07.722429 |
description | Todo.txt file format parser |
homepage | |
repository | https://github.com/kstep/todotxt.rs |
max_upload_size | |
id | 4618 |
size | 35,940 |
This is a todo.txt file format parser. The format was proposed by Gina Trapani. This parser supports some custom tags:
due:YYYY-MM-DD
).t:YYYY-MM-DD
).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
}
}
Licensed under either of
at your option.
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.