Handle canceled tasks
This commit is contained in:
parent
f1ac5bb718
commit
29d1d5a2ef
4 changed files with 12 additions and 4 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -173,7 +173,7 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "day-reporter"
|
name = "day-reporter"
|
||||||
version = "1.3.0"
|
version = "1.3.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "day-reporter"
|
name = "day-reporter"
|
||||||
version = "1.3.0"
|
version = "1.3.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::things::task::Task;
|
use crate::things::task::{Task, Status};
|
||||||
use crate::names::sanitize_names;
|
use crate::names::sanitize_names;
|
||||||
|
|
||||||
/// Given a notes field and a list of possible tags for sections, return the content of triple tick
|
/// Given a notes field and a list of possible tags for sections, return the content of triple tick
|
||||||
|
|
@ -176,10 +176,16 @@ impl Reporter for MarkdownReporter {
|
||||||
.map(|l| format!("\n{}- {}", String::from(" ").repeat(depth + 4), l))
|
.map(|l| format!("\n{}- {}", String::from(" ").repeat(depth + 4), l))
|
||||||
.collect::<Vec<String>>()
|
.collect::<Vec<String>>()
|
||||||
.join("");
|
.join("");
|
||||||
let mut output = format!("\n{}- {}{}", String::from(" ").repeat(depth), task.title, relevant_notes);
|
let title = if task.status == Status::Canceled {
|
||||||
|
format!("~{}~", task.title)
|
||||||
|
} else {
|
||||||
|
task.title.to_string()
|
||||||
|
};
|
||||||
|
let mut output = format!("\n{}- {}{}", String::from(" ").repeat(depth), title, relevant_notes);
|
||||||
if options.sanitize_names {
|
if options.sanitize_names {
|
||||||
output = sanitize_names(&output, &task.tags);
|
output = sanitize_names(&output, &task.tags);
|
||||||
}
|
}
|
||||||
|
|
||||||
output
|
output
|
||||||
}
|
}
|
||||||
fn report_project(&mut self, project: &ProjectTree, depth: usize, options: &ReportOptions) -> String {
|
fn report_project(&mut self, project: &ProjectTree, depth: usize, options: &ReportOptions) -> String {
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ pub enum Status {
|
||||||
Incomplete,
|
Incomplete,
|
||||||
#[serde(rename = "open")]
|
#[serde(rename = "open")]
|
||||||
Open,
|
Open,
|
||||||
|
#[serde(rename = "canceled")]
|
||||||
|
Canceled,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Deserialize, Debug)]
|
||||||
|
|
|
||||||
Reference in a new issue