TodoTxt
An Elixir library for parseing todo.txt files
More information about todo.txt can be found at:
This package can be installed
by adding todo_txt
to your list of dependencies in mix.exs
:
def deps do
[
{:todo_txt, "~> 0.1.0"}
]
end
todos =
File.read!("todo.txt")
|> String.split("\n")
|> Enum.map(&Todo.parse/1)
to_write =
todos
|> Enum.map(&Todo.to_string/1)
|> Enum.join("\n")
File.write!("todo.txt.diff", to_write)
todos = File.read!("todo.txt") |> String.split("\n") |> Enum.map(&Todo.parse/1)
{done, todo} = Enum.split_with(todos, fn t -> t.done end)
File.write!("todo.txt", Enum.join(Enum.map(todo, &Todo.to_string/1), "\n"))
File.write!("done.txt", Enum.join(Enum.map(done, &Todo.to_string/1), "\n"))
- Add a File Watcher for Local todo.txt
- Add a File Watcher for Google Drive todo.txt