Custom workflows/TODO markers via plugins?

I was hoping to use HOLD and FIX as todo markers in addition to the usual TODO-DOING-DONE or NOW-LATER-DONE. I also have both the Agenda plugin and the Todo List plugin installed, which supposedly allow custom tags, but HOLD and FIX don’t seem to work. I messed around with their respective .json files, and HOLD and FIX still don’t work, but WAITING and CANCELED do.

Could someone please explain how todo markers work? Is it possible to edit them anywhere?

Some earlier related posts:
Introduce custom workflows as a primitive to replace TODOs - Feature Requests - Logseq
Add support for customisable TODO keywords - Feature Requests - Logseq

1 Like

There is a plugin in the marketplace named Logseq Custom Workflow Plugin have you tried it?

Maybe I’m missing something, but this plugin seems to basically be a text expander. It doesn’t include the custom markers as todos, it just uses a shortcut to mark a block with custom text.

It might be an issue with the :block/marker attribute, probably. Apart from many hard-coded parts, it might also be related to the database settings. (They are all hard-coded.) If you search for one of the following keywords in the software source code, such as “NOW”, “LATER”, “DOING”, “DONE”, “CANCELED”, “CANCELLED”, “IN-PROGRESS”, “TODO”, “WAIT”, “WAITING”, you will see some code involving these keywords, for example:

(defn marker-pattern [format]
  (re-pattern
   (str "^" (if (= format :markdown) "(#+\\s+)?" "(\\*+\\s+)?")
        "(NOW|LATER|TODO|DOING|DONE|WAITING|WAIT|CANCELED|CANCELLED|IN-PROGRESS)?\\s?")))
(def bare-marker-pattern
  #"(NOW|LATER|TODO|DOING|DONE|WAITING|WAIT|CANCELED|CANCELLED|IN-PROGRESS){1}\s+")

Or

(defn marker-cp
  [{:block/keys [pre-block? marker] :as _block}]
  (when-not pre-block?
    (when (contains? #{"IN-PROGRESS" "WAIT" "WAITING"} marker)
      [:span {:class (str "task-status block-marker " (string/lower-case marker))
              :style {:margin-right 3.5}}
       (string/upper-case marker)])))

If you try to insert a custom keyword in these code snippets, then Ctrl+Enter will replace that keyword with LATER (rather than appending it at the beginning of the line). However, similar to the Logseq Custom Workflow Plugin, Logseq does not render custom keywords in this manner as task items. Because Logseq determines whether to render an item as a task based on the value of :block/marker (as shown in the latter code).

Unfortunately, for custom task keyword entries, the :block/keys does not contain a marker keyword, just like a regular entry. So even if you add a matching condition, it won’t match (because a null value can’t possibly match). I haven’t found a way to add a custom :block/marker attribute for custom keyword entries. I don’t know how to append this attribute.
(Use machine translation)

1 Like