Inspired by the conversation in #53 and #55 on org-mode, this draft PR is an alternative to #53 that changes the grammar of TaskListItem from containing a checkbox with checked and unchecked states, to containing the status of a task instead: finished, unfinished, and inprogress.
Some notes:
Feedback is encouraged!
I initially used done, not_done, and in_progress, but there was another done string in the code I wanted to avoid confusion with, and I didn't want to introduce - or _ into the CSS classes without a conversation first.
I changed most mentions of checkbox, but some still remain. At the time I couldn't decide if the term checkbox should still be used to describe the [ ] syntax, or if it should be more explicitly called a Task
The original logic checked for checked or unchecked, then it used an else for the other option. This is handy if you start with checkbox === " " to find the unchecked, as the else will catch both [x] and [X] (and [o]) as checked. I added inprogress into these checks without considering if the logical order should be changed.
I don't like how they are rendered in HTML (using a CSS class and unicode character), but I didn't have a better idea
Adding a 4th state like paused ([?]) is easy enough, but the way states are added right now doesn't exactly lend itself to adding more easily (if it's even needed)
Inspired by the conversation in #53 and #55 on org-mode, this draft PR is an alternative to #53 that changes the grammar of
TaskListItem
from containing acheckbox
withchecked
andunchecked
states, to containing thestatus
of a task instead:finished
,unfinished
, andinprogress
.Some notes:
done
,not_done
, andin_progress
, but there was anotherdone
string in the code I wanted to avoid confusion with, and I didn't want to introduce-
or_
into the CSS classes without a conversation first.checkbox
, but some still remain. At the time I couldn't decide if the term checkbox should still be used to describe the[ ]
syntax, or if it should be more explicitly called a Taskchecked
orunchecked
, then it used anelse
for the other option. This is handy if you start withcheckbox === " "
to find theunchecked
, as theelse
will catch both[x]
and[X]
(and[o]
) aschecked
. I addedinprogress
into these checks without considering if the logical order should be changed.paused
([?]
) is easy enough, but the way states are added right now doesn't exactly lend itself to adding more easily (if it's even needed)