Enhance logbook (#2987)

* fix(logbook): fix https://github.com/logseq/logseq/issues/2866 partially

Timetracked logbook shouldn't only shown up in block with scheduled
timestamp.

* fix https://github.com/logseq/logseq/issues/2866

* cleanup: arguments in some commands

* Revert "cleanup: arguments in some commands"

This reverts commit 0e7df6e5fe.

* enhance(logbook): add two-level options to show logbook

This PR offer two options to control when the logbook drawer shows in
your block.

- `:logbook/enabled-in-timestamped-blocks`: This option defaults to
true, which means that the logbook drawer will be visible in blocks
only with scheduled or deadline timestamp after timetracking.

- `:logbook/enabled-in-all-blocks`: This option defaults to
nil. Adding `:logbook/enabled-in-all-blocks true` to your config file
will enable the logbook shown-up for all blocks after timetracking.

* fix last commit

* fix: timetrack for now->later on repeated task

* fix: add default marker

* enhance(logbook): support seconds

* logbook: add `with-second-support` doc

* logbook: re-define display config

* fix logbook string indentation

Co-authored-by: leizhe <leizhe@leizhedeMacBook-Air.local>
This commit is contained in:
llcc
2021-10-22 22:24:53 +08:00
committed by GitHub
parent ba6d7930f8
commit 584c929839
6 changed files with 117 additions and 59 deletions

View File

@@ -795,7 +795,16 @@
(reduce (fn [content [old new]]
(string/replace content old new))
content))
content (string/replace-first content "DOING" "TODO")
content (string/replace-first
content marker
(case marker
"DOING"
"TODO"
"NOW"
"LATER"
marker))
content (clock/clock-out format content)
content (drawer/insert-drawer
format content "logbook"