benjypng / logseq-kanban-plugin

MIT License
102 stars 9 forks source link

Query snippet command as showcased in README.md #27

Closed Wilker-uwu closed 1 year ago

Wilker-uwu commented 1 year ago

In the readme file showing off the plugin, you feature a function to quickly query marked items in a list as tasks done, but the problem is that i don't know anything about making such queries in the first place, and having a way to quickly paste this snippet would be very helpful. Could you implement something similar to be written right away? to make it easier to use, being possible to paste in both before or after the list is already done

thank you for making this project, i appreciate it! <3

benjypng commented 1 year ago

Hi, you can try this:

#+BEGIN_QUERY
{:title [:h3 "Tasks" ]
 :query [:find (pull ?b [*])
   :where
      [?b :block/marker ?marker]
   [(contains? #{"TODO" "DOING" "DONE"} ?marker)]
 ]
}
#+END_QUERY

So your block will look something like:

- {{renderer :kanban_iflhrirda}}
    - tasks
        - #+BEGIN_QUERY
{:title [:h3 "Tasks" ]
 :query [:find (pull ?b [*])
   :where
      [?b :block/marker ?marker]
   [(contains? #{"TODO" "DOING" "DONE"} ?marker)]
 ]
}
#+END_QUERY
Wilker-uwu commented 1 year ago

tysm <3