enh: colorize tasks based on patterns
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
TKDO |
Confirmed
|
Medium
|
Selene ToyKeeper |
Bug Description
Some users find colors useful to show which tasks go together. TKDO should offer a way to colorize tasks in a user-configurable way.
The easiest approach would be to have a simple list of patterns and colors, such as:
colors = (
('red', '<--'),
('green', 'buy'),
('blue', 'email'),
)
The questions here are:
- Should patterns be plain text or regular expressions?
- Should patterns match only title text, or other attributes? Which attributes? Contexts are an obvious fit, but what about more complicated matches, like tasks due in the next week?
- Should colors be applied to the entire task, or should it be possible to apply different colors to different parts of the title?
- Should the background color be configurable, or only the foreground?
My inclination for a first pass is to use plain text patterns, compare them to the raw text of the task lines, and colorize the entire task. No background colors for now. This is the simplest option, and may be sufficient.
In any case, colors should be displayed both in the GUI and on the command line, if enabled. TKDO will need to translate the colors to HTML and/or vt100 codes as appropriate.
Changed in tkdo: | |
milestone: | none → 0.7 |
Changed in tkdo: | |
milestone: | 0.7 → 0.8 |
BTW, see contrib/tkdoclrs in trunk r135 for Bill Powell's reference implementation.