Here is my first post to talk about my workflow and how i edited the checklist plugin to adapt to my workflow. This post is for curious developers who wants to fine tune the checklist plugin to add new features to adapt to their workflow
TLDR : I have added a feature to ignore a certain tag in obsidian checklist plugin while filtering the todo tasks to display in checklist tab.
Modifying checklist plugin in obsidian
The checklist plugin lacks major features to exclude and include multiple tags and for that reason i am not able to carry forward my workflow. So here is what i did, the section you see in the below image marked in arrow, is a new feature added to exclude tasks with this tag alone.
The nerd part of the implementation
The file we are going to work is main.js
in the obsidian-checklist
plugins folder inside .obsidian/plugins
-
Add the feature spec to the Default settings map
-
Add this UI element in TodoSettingTab class which extends obsidian.PluginSettingTab
-
Add ignoreTag ( or the one of your choice when you implement your own ) to the parseTodos function arguments
-
I have added the ignoreTag to the filter function from the result of flatmap ( has list of files ), you can do anything with the result from the file.
findAllTodosInFile
function basically parses the markdown files and gets all the todos and their metadata and pushes it to list. You can take this list and implement anything you want. Your task text will be in the attributetodo.originalText
and you can modify it however you want.
-
Add it to your instance function to get the props
-
Add it to the set function list
-
Make sure to return it
-
Add this to the init function of the constructor of your App class and make sure to assign the same map number
14
as mentioned when you added it to the set function
-
Now that we did all this, we need to get the settingValue “ignoreTag” prop from the UI element
and Voila, you just added a new feature to the checklist plugin
End Result
-
Now the plugin feature is visible in my checklist plugin settings tab
-
Now lets see about what happens when we dont add the ignore tag to our task ( btw all my todos would have to go my checklist and i only want to ignore
#inbox
-
Now adding the ignore tag to my todo task, it disappears from my checklist