From fbbdd5eef8efc2b86070ac59cb7c75013fb3664f Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Tue, 30 Jul 2024 09:09:54 +0300 Subject: [PATCH] feat: separate description specifiers --- README.md | 9 ++++++--- src/task.rs | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index abb4393..d1f6a08 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,10 @@ An active tag or state filter will also set that attribute for newly created tas - `parentid` - `name` - `state` -- `tags` - `hashtags` -- `desc` - accumulated notes of the task +- `tags` - values of all nostr tags associated with the event, except event tags +- `desc` - last note on the task +- `description` - accumulated notes on the task - `path` - name including parent tasks - `rpath` - name including parent tasks up to active task - `time` - time tracked @@ -73,7 +74,9 @@ An active tag or state filter will also set that attribute for newly created tas - TBI: `progress` - how many subtasks are complete - TBI: `progressp` - subtask completion in percent -For debugging: `props`, `alltags` +For debugging: `props`, `alltags`, `descriptions` + +TODO: Combined formatting and recursion specifiers ## Plans diff --git a/src/task.rs b/src/task.rs index ddf8872..57e03ac 100644 --- a/src/task.rs +++ b/src/task.rs @@ -143,6 +143,8 @@ impl Task { "state" => self.state().map(|s| s.to_string()), "name" => Some(self.event.content.clone()), "time" => Some(format!("{}m", self.time_tracked().div(60))), + "desc" => self.descriptions().last().cloned(), + "description" => Some(self.descriptions().join(" ")), "hashtags" => self.filter_tags(|tag| { tag.single_letter_tag() .is_some_and(|sltag| sltag.character == Alphabet::T) @@ -160,7 +162,6 @@ impl Task { "{:?}", self.descriptions().collect::>() )), - "desc" | "description" => self.descriptions().last().cloned(), _ => { warn!("Unknown task property {}", property); None