Home
Softono
todo.txt

todo.txt

Open source Go
25
Stars
9
Forks
1
Issues
2
Watchers
2 years
Last Commit

About todo.txt

‼️ A complete primer on the whys and hows of todo.txt.

Platforms

Web Self-hosted

Languages

Go

Links

todotxt

Yet another a Go library for Gina Trapani's todo.txt files. ✅

PkgGoDev License GitHub Action Workflow Go Report Card Codacy Badge Codecov

Features

Based on go-todotxt from Fabio Berchtold with:

  • [x] Go mod support
  • [x] Segments for task string
  • [x] Task due today is not overdue
  • [x] Negative Due() for overdue tasks
  • [x] Support multiple options for sorting and filtering
  • [x] More sorting options: by ID, text, context, project
  • [x] Preset filters

Usage

A quick start example:

import (
    todo "github.com/1set/todotxt"
)

// ...

if tasklist, err := todo.LoadFromPath("todo.txt"); err != nil {
    log.Fatal(err)
} else {
    tasks := tasklist.Filter(todo.FilterNotCompleted).Filter(todo.FilterDueToday, todo.FilterHasPriority)
    _ = tasks.Sort(todo.SortPriorityAsc, todo.SortProjectAsc)
    for i, t := range tasks {
        fmt.Println(t.Todo)
        // oh really?
        tasks[i].Complete()
    }
    if err = tasks.WriteToPath("today-todo.txt"); err != nil {
        log.Fatal(err)
    }
}

For more examples and details, please check the Go Doc.

Credits