noahlange / tiddlymark

Plugins and tasks for TiddlyWiki to improve Markdown support.
4 stars 3 forks source link

Checklist option #14

Open edo0 opened 1 year ago

edo0 commented 1 year ago

Dear @noahlange, thank you for developing this Tiddlywiki plugin. I have tried unsuccessfully to reproduce the markdown-style checkbox, but without success. - [ ] Am I missing something, else would there be a way to implement it in the plugin? Thank you in advance

noahlange commented 1 year ago

Hey there!

Gut check is that it might be a bit tricky, especially if you're angling for a GitHub-style "click to complete". It'd probably be something like this:

  1. create a new parser rule for the inline checkbox (you'd likely want to track some sort of positional information to update the source text if/when the checkbox is clicked)
  2. find the TiddlyWiki checkbox input widget (this may or may not exist in core)
  3. create the JsonML node for that widget, passing along the positional information
  4. ...I don't know how checkboxes work in TiddlyWiki...
  5. Profit.

Alternatively, you can just kick out an input tag with type="check" and that'd do the trick, too. I'll take a look this weekend if I have some time.