5 Commits

Author SHA1 Message Date
e058abfa96 added frontmatter to config
All checks were successful
Test / test (push) Successful in 49s
2026-04-15 17:41:05 -04:00
6b8b8a8f51 Merge pull request 'test' (#5) from workflow-test into main
All checks were successful
Test / test (push) Successful in 39s
Reviewed-on: #5
2026-04-15 00:43:30 -04:00
7f1162c999 Merge branch 'main' into workflow-test
All checks were successful
Test / test (push) Successful in 39s
Build / test (pull_request) Successful in 1m14s
2026-04-15 00:43:22 -04:00
afb00ba57a Merge branch 'workflow-test'
All checks were successful
Test / test (push) Successful in 40s
2026-04-15 00:40:12 -04:00
1ec217732f build workflow
All checks were successful
Test / test (push) Successful in 41s
2026-04-15 00:29:05 -04:00
5 changed files with 27 additions and 13 deletions

View File

@@ -4,6 +4,9 @@ on:
types:
- published
pull_request:
types:
- opened
- edited
jobs:
test:
@@ -12,10 +15,6 @@ jobs:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- name: Run tests
run: cargo test --release
- name: Run build
run: cargo test
- name: Run tests
run: cargo build --release --target x86_64-unknown-linux-gnu
- uses: https://github.com/christopherHX/gitea-upload-artifact@v4
with:
name: rusty-task
path: target/x86_64-unknown-linux-gnu/release/rusty-tasks

View File

@@ -1,8 +1,6 @@
- [ ] Obsidian properties
- [ ] encoding in YAML (using Serde)
- [ ] config for default properties
- [x] config for default properties
- [ ] formatting for properties such as dates
- [x] update rendering to use comrak (it's been update)
- [ ] figure out what frontmatter obsidian uses
- [ ] generate title

View File

@@ -10,6 +10,9 @@ pub struct Args {
/// show current config file
#[arg(short = 'C', long)]
pub current_config: bool,
// generate config file (output to stdout)
#[arg(long, default_value_t = true)]
pub gen_config: bool,
/// view a specific date's file (YYYY-MM-DD)
#[arg(short, long)]

View File

@@ -4,6 +4,7 @@ extern crate serde_json;
use figment::providers::{Env, Format, Json, Serialized};
use figment::Figment;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::env::var;
use std::fs::File;
use std::io::Write;
@@ -13,7 +14,9 @@ use std::path::PathBuf;
pub struct Config {
pub editor: String,
pub sections: Vec<String>,
pub scratch_section: String,
pub notes_dir: String,
pub frontmatter: HashMap<String, String>,
}
impl Default for Config {
@@ -21,7 +24,9 @@ impl Default for Config {
Config {
editor: "nano".into(),
sections: vec!["Daily".into(), "Weekly".into(), "Monthly".into()],
scratch_section: "".into(),
notes_dir: "~/Notes".into(),
frontmatter: HashMap::new(),
}
}
}

View File

@@ -10,14 +10,14 @@ use clap::Parser;
use cli::Args;
use comrak::options::{Extension, Parse};
use comrak::{format_commonmark, Arena, Options};
use config::Config;
use config::{Config, ConfigError};
use log;
use logging::get_logging_level;
use resolve_path::PathResolveExt;
use simple_logger::init_with_level;
use std::fs;
use std::path::Path;
use std::process::Command;
use std::process::{exit, Command};
use todo::{File as TodoFile, TaskGroup};
use crate::file::{extract_sections, process_doc_tree};
@@ -51,6 +51,15 @@ fn main() {
}
}
if args.gen_config {
let buf = match serde_json::to_string_pretty(&Config::default()) {
Ok(text) => text,
_ => panic!("Could not generate config text"),
};
println!("{}", buf);
return;
}
// set witch config file to load
let cfg_file = match args.config {
Some(file) => file,