todos = [
Todo("Call Mom @phone +Family"; priority='A', creation_date=Date(2024, 1, 15), metadata=Dict("due" => "2024-01-20")),
Todo("Buy groceries @store +Errands"; priority='B', creation_date=Date(2024, 1, 20), metadata=Dict("due" => "2024-01-25")),
Todo("Write report @computer +Work"; priority='A', creation_date=Date(2024, 1, 10), metadata=Dict("due" => "2024-02-01")),
Todo("Schedule dentist @phone +Health"; priority='C'),
Todo("Pay bills"; completed=true, creation_date=Date(2024, 1, 10), completion_date=Date(2024, 1, 16)),
Todo("Clean garage +Home"),
]
path = tempname()
write_todos(path, todos)
tf = TodoFile(path)HTML Views
HTML Views
TodoFiles provides four HTML views for rich display of todo lists in Jupyter and Pluto notebooks. Each view renders via show(io, MIME"text/html"(), ...), so simply returning a view object in a notebook cell will display it.
Setup
Let’s create a sample TodoFile to demonstrate each view:
ListView
ListView renders each task as a card with checkboxes, priority badges, and colored tag pills:
ListView(tf)This is also the default HTML display for any TodoFile:
tf # same as ListView(tf)TableView
TableView renders tasks as a data table with columns for status, priority, description, tags, and dates:
TableView(tf)| Done | Priority | Description | Tags | Created | Completed |
|---|---|---|---|---|---|
| A | Call Mom | @phone+Family | 2024-01-15 | ||
| B | Buy groceries | @store+Errands | 2024-01-20 | ||
| A | Write report | @computer+Work | 2024-01-10 | ||
| C | Schedule dentist | @phone+Health | |||
| ✓ | Pay bills | 2024-01-10 | 2024-01-16 | ||
| Clean garage | +Home |
KanbanView
KanbanView displays tasks grouped into columns. The default grouping is by :priority:
KanbanView(tf)A
B
C
(none)
Group by completion status
KanbanView(tf, :completed)Done
Pending
Group by project
Tasks with multiple projects appear in each relevant column:
KanbanView(tf, :projects)Errands
Family
Health
Home
Work
(no project)
Group by context
KanbanView(tf, :contexts)computer
phone
store
(no context)
GanttView
GanttView renders tasks as horizontal bars on a timeline. Each task needs a creation_date (start) and either a due metadata key or completion_date (end) to appear on the chart. Tasks without both dates are silently excluded.
GanttView(tf)| Task | Timeline |
|---|---|
| A Call Mom | |
| B Buy groceries | |
| A Write report | |
| Pay bills |
Bars are colored by priority and completed tasks are shown with reduced opacity.
The html_view Convenience Function
html_view is a single entry point that returns the appropriate view type:
html_view(tf) # ListView (default)html_view(tf; view=:table)| Done | Priority | Description | Tags | Created | Completed |
|---|---|---|---|---|---|
| A | Call Mom | @phone+Family | 2024-01-15 | ||
| B | Buy groceries | @store+Errands | 2024-01-20 | ||
| A | Write report | @computer+Work | 2024-01-10 | ||
| C | Schedule dentist | @phone+Health | |||
| ✓ | Pay bills | 2024-01-10 | 2024-01-16 | ||
| Clean garage | +Home |
html_view(tf; view=:kanban, group_by=:projects)Errands
Family
Health
Home
Work
(no project)
html_view(tf; view=:gantt)| Task | Timeline |
|---|---|
| A Call Mom | |
| B Buy groceries | |
| A Write report | |
| Pay bills |