forked from janek/mostr
1
0
Fork 0

feat: separate description specifiers

This commit is contained in:
xeruf 2024-07-30 09:09:54 +03:00
parent f89615d8e4
commit fbbdd5eef8
2 changed files with 8 additions and 4 deletions

View File

@ -63,9 +63,10 @@ An active tag or state filter will also set that attribute for newly created tas
- `parentid` - `parentid`
- `name` - `name`
- `state` - `state`
- `tags`
- `hashtags` - `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 - `path` - name including parent tasks
- `rpath` - name including parent tasks up to active task - `rpath` - name including parent tasks up to active task
- `time` - time tracked - `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: `progress` - how many subtasks are complete
- TBI: `progressp` - subtask completion in percent - TBI: `progressp` - subtask completion in percent
For debugging: `props`, `alltags` For debugging: `props`, `alltags`, `descriptions`
TODO: Combined formatting and recursion specifiers
## Plans ## Plans

View File

@ -143,6 +143,8 @@ impl Task {
"state" => self.state().map(|s| s.to_string()), "state" => self.state().map(|s| s.to_string()),
"name" => Some(self.event.content.clone()), "name" => Some(self.event.content.clone()),
"time" => Some(format!("{}m", self.time_tracked().div(60))), "time" => Some(format!("{}m", self.time_tracked().div(60))),
"desc" => self.descriptions().last().cloned(),
"description" => Some(self.descriptions().join(" ")),
"hashtags" => self.filter_tags(|tag| { "hashtags" => self.filter_tags(|tag| {
tag.single_letter_tag() tag.single_letter_tag()
.is_some_and(|sltag| sltag.character == Alphabet::T) .is_some_and(|sltag| sltag.character == Alphabet::T)
@ -160,7 +162,6 @@ impl Task {
"{:?}", "{:?}",
self.descriptions().collect::<Vec<&String>>() self.descriptions().collect::<Vec<&String>>()
)), )),
"desc" | "description" => self.descriptions().last().cloned(),
_ => { _ => {
warn!("Unknown task property {}", property); warn!("Unknown task property {}", property);
None None