Crates.io | libdonow |
lib.rs | libdonow |
version | 0.1.0 |
source | src |
created_at | 2024-08-23 13:50:14.719533 |
updated_at | 2024-08-23 13:50:14.719533 |
description | A library for parsing and manipulating todo.txt files efficiently using regex |
homepage | https://noobscience.in/projects/libdonow |
repository | https://github.com/newtoallofthis123/libdonow |
max_upload_size | |
id | 1349182 |
size | 51,729 |
A rust library for the todo.txt format. The library supports all of the features of format, including priorities, contexts, projects, and due dates. This library is the basis for the donow application which is a native todo.txt application written using the Tauri Framework.
libdonow is has various features that make it easy to work with todo.txt files.
You can simply open up a todo.txt file using the custom TodoFile
wrapper struct that has
various methods to interact with the file.
use libdonow::file::TodoFile;
fn main(){
let file = TodoFile::new("todo.txt");
file.rearrange();
file.save();
println!("{}", file);
let todo = file[0];
todo.toggle_status();
println!("{}", todo);
}
The TodoFile struct also has various implementations and methods to feel like a Vec
The library also has powerful features to work with a single todo item.
Each todo item is parsed using some fancy regex features and is stored in a struct called Todo
.
the Todo
struct follows a only what's needed approach so you have various functions and utilities to retrieve only what is necessary
without having to parse the entire todo item.
For example, the get_projects
method in the TodoFile struct returns a Vec
for todo in &self.todos {
if let Ok(Some(project)) = todo.parse_project() {
projects.push(project);
}
}
More information about the library can be found in the docs.
If you would like to contribute to the project, feel free to fork the repository and submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.