Skip to content

[Feature] Implement optional [x]it! support #44

@schlagmichdoch

Description

@schlagmichdoch

Thanks for this great plugin!

I like your current implementation of todo items being rendered as checkboxes directly in the markdown. I would love to have the same thing for all [x]it! todo items.

Current state

By adapting this code by @alondmnt via the Rich Markdown plugin I was able to render [x]it! todos as rich text elements which works and looks great. As @alondmnt I have added a custom todo state blocked (- [!])

Sadly, rendering the elements this way these just look like checkboxes but are not interactive (no toggling via click / ctrl + click etc.). Also, adding custom CSS to the mobile apps is not possible so this is currently a desktop only solution.:

Open Screenshots Image

Line not active -> "checkboxes" rendered

Image

Line active / selected -> "checkboxes" not rendered; markdown syntax stylized

Edit: I have since changed the implementation slightly and have moved everything into this gist.

Idea

I would like to add [x]it! support via an opt-in setting to this plugin mainly by changing checkbox replacement file. I'd like to implement the above styling and additionally:

  1. Rendering all [x]it! items as open/unchecked checkboxes with different colors and content symbols (@, ~, ?)
  2. Clicking any [x]it! checkbox sets the todo item to checked
  3. CTRL + Clicking any [x]it! item sets the todo item to checked
  4. Right-clicking / long tapping any todo item (including [x]it!-items) opens a small tooltip menu to set the current state (open, overdue, etc.) or if that's not possible: opens the context menu with the option to set the checkbox state
  5. (Optional) Implement rendering of [x]it! items in the preview and when printed.

About 1-3

We can overwrite the rendering of checkboxes for [x]it! items via CSS which preserves the interactivity (2-3):
https://stackoverflow.com/a/56411758

About 5.

The Inline Todo Plugin currently does something similar via this renderer:

Open Screenshot Image

Implementation

Would you be willing to merge such a PR to your plugin as it is already about rich markdown or would you want me to create a standalone plugin?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions