jgm / djot.js

JavaScript implementation of djot
MIT License
141 stars 15 forks source link

Simplify AST for TaskListItem #58

Open matklad opened 1 year ago

matklad commented 1 year ago

Syntactically, we allow only two status here, checked and unchecked, so a boolean should be enough.

cc #55

bdarcus commented 1 year ago

I'll just raise the obvious question: should it really be a boolean?

In org-mode, statuses are configurable, and there can be more than two. Here's the default doom config:

https://github.com/doomemacs/doomemacs/blob/07fca786154551f90f36535bfb21f8ca4abd5027/modules/lang/org/config.el#L164

IIRC, default for org itself is "done", "not done", "in progress".

mikekasprzak commented 6 months ago

I wasn't familiar with org-mode before reading about it this evening, but having an org-mode style "in progress" state ([-]) is a nice idea. I wasn't sure about it at first, but after pondering I think it's the sort of thing my users would like.

Having a "paused" state ([?]) like doom is interesting, but I think I prefer the idea of sticking to 3 states like org-mode just so this doesn't get too out of hand.

The issue (as I see it), HTML doesn't exactly support multiple states for checkboxes. There's a CSS selector :indeterminate and an indeterminate state that can be set using JavaScript, but not in raw HTML.

That said, given that this is called TaskListItem and not CheckboxItem, it does seem reasonable to abandon checkbox terminology like "checked" for statuses that make sense for tasks, such as done/finished, not-done/unfinished, and in-progress.

:shrug: my 2 cents