I love checklists, so one feature I wanted is the ability to "clear all" the check boxes with one button.
Here's a short snippet that basically modifies the current page text to accomplish that:
chklist = chklist or {}
function chklist.clear_checklists()
return widget.html(dom.button {
"Clear Checklists",
class = "clear-checklists-button",
onclick = function()
local text = editor.getText()
local newText = string.gsub(text, "%[[xX]%]", "[ ]")
editor.setText(newText)
end,
})
end
Then, just place the button anywhere in your checklist page (${chklist.clear_checklists()}) and you're done!
I did try to modify this to change the attribute directly for tasks with custom task states, but didn't get very far. If that's actually possible, let me know!