A "Preferred Workflow" supporting Markdown Tasks

Even if only to render the todo items, being able to see markdown tasks as checkboxes would be a huge savings.

I also don’t want to see “TODO/DOING” rendering because I use the same graph with different tools. When editing notes, I universally use the - [ ] syntax to track work to be done.

Any implementation doesn’t need to be as robust as the Obsidian Task Plug-in. What I’m asking for is a way to see the task rendered as such without a plug-in.

Logseq is my preferred daily journaling and idea capture tool, including top-of-mind tasks. However, I render those tasks in Obsidian or edit them directly when working on a specific note.

If you mean to type this:

- [x] Write the press release
- [ ] Update the website
- [ ] Contact the media

and to get this visually (but not functionally):


then add the following code in file custom.js (create inside folder logseq if missing):

const contentelems = document.getElementsByClassName("block-content");
const contentsObserver = new MutationObserver(function onMutated(){
    Array.prototype.map.call(contentelems, (elem)=>{
        const data = elem.dataset
        const status = data.taskStatus
        if (status === "handled") return

        data.taskStatus = "handled"
        const span = elem.querySelector('div > div > div > span')
        const text = span?.textContent
        if (!text) return

        function replaceWith(icon){
            const text = span.firstChild.textContent.slice(4)
            span.firstChild.remove()
            if (text) span.prepend(new Text(text))

            const spanTi = document.createElement('span')
            spanTi.className = 'ti'
            spanTi.innerHTML = icon
            span.prepend(spanTi)
        }
        if (text.startsWith("[x] ")) replaceWith("&#xeb28 ")
        else if (text.startsWith("[ ] ")) replaceWith("&#xeb2c ")
    })
});
contentsObserver.observe(document.getElementById("app-container"), {
    attributes: true,
    subtree: true,
    attributeFilter: ["class"]
});

That’s really cool. However, I was thinking more about the functionality that - [ ] works like the TODO/DONE function.

Cosmetics aren’t necessary. I can tell it is a task with text along. I’m looking for engagement with the task and for Logseq to recognize it as such.

In other words, you are not looking for a mere customization. Moving this to Feature Requests.

1 Like