My personal-knowledge-system, with deeply integrated task tracking and long term goal planning capabilities.
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: initialized config is now pretty printed

+55 -24
+11 -13
.config/config.ron
··· 1 1 ( 2 - directory: "./ZettelKasten", 2 + directory: "/Users/suri/dev/projects/filaments/ZettelKasten", 3 3 global_key_binds: { 4 + "up": MoveUp, 4 5 "ctrl-c": Quit, 5 6 "ctrl-z": Suspend, 6 - "up": MoveUp, 7 7 "down": MoveDown, 8 8 }, 9 9 zk: ( 10 10 keybinds: { 11 - "<Ctrl-n>": NewZettel, 12 11 "enter": OpenZettel, 13 - "tab": SwitchTo ( 14 - region: Todo 15 - ), 16 - 12 + "tab": SwitchTo( 13 + region: Todo, 14 + ), 15 + "<Ctrl-n>": NewZettel, 17 16 }, 18 17 ), 19 18 todo: ( 20 19 keybinds: { 21 - "j": MoveDown, 22 20 "k": MoveUp, 23 - "tab": SwitchTo ( 24 - region: Zk 25 - ), 26 - 21 + "j": MoveDown, 22 + "tab": SwitchTo( 23 + region: Zk, 24 + ), 27 25 }, 28 26 ), 29 - ) 27 + )
+27
.config/default_config.ron
··· 1 + ( 2 + directory: "{INSERT_ROOT_HERE}", 3 + global_key_binds: { 4 + "up": MoveUp, 5 + "ctrl-c": Quit, 6 + "ctrl-z": Suspend, 7 + "down": MoveDown, 8 + }, 9 + zk: ( 10 + keybinds: { 11 + "enter": OpenZettel, 12 + "tab": SwitchTo( 13 + region: Todo, 14 + ), 15 + "<Ctrl-n>": NewZettel, 16 + }, 17 + ), 18 + todo: ( 19 + keybinds: { 20 + "k": MoveUp, 21 + "j": MoveDown, 22 + "tab": SwitchTo( 23 + region: Zk, 24 + ), 25 + }, 26 + ), 27 + )
-1
src/cli/process.rs
··· 44 44 45 45 Self::Zettel(zettel_sub_command) => { 46 46 let conf = Config::parse()?; 47 - // let ws = Workspace::instansiate(conf.fil_dir).await?; 48 47 let mut kt = Kasten::instansiate(conf.fil_dir).await?; 49 48 50 49 match zettel_sub_command {
+6 -2
src/config/mod.rs
··· 7 7 8 8 use color_eyre::eyre::Result; 9 9 use directories::ProjectDirs; 10 + use ron::ser::PrettyConfig; 10 11 11 12 use crate::config::{file::RonConfig, keymap::KeyMap}; 12 13 ··· 31 32 .map(PathBuf::from) 32 33 }); 33 34 34 - const DEFAULT_CONFIG: &str = include_str!("../../.config/config.ron"); 35 + const DEFAULT_CONFIG: &str = include_str!("../../.config/default_config.ron"); 35 36 36 37 #[derive(Debug, Clone)] 37 38 pub struct Config { ··· 47 48 48 49 default_conf.directory = fil_dir.canonicalize()?; 49 50 50 - Ok(ron::to_string(&default_conf)?) 51 + Ok(ron::ser::to_string_pretty( 52 + &default_conf, 53 + PrettyConfig::default(), 54 + )?) 51 55 } 52 56 /// Parse the config from `~/.config/filaments`, but will prioritize 53 57 /// `FIL_CONFIG_DIR`.
+3 -7
src/tui/components/zk/mod.rs
··· 105 105 106 106 let preview = Preview::from(zettel.content(&kt.index).clone()); 107 107 108 - // okay now that we have the zettel we need to construct the zettel out of this id 109 - let zettel_view: ZettelView = zettel.into(); 110 - 111 108 drop(kt); 112 109 113 110 Ok(Self { ··· 116 113 kh, 117 114 layouts: Layouts::default(), 118 115 zettel_list, 119 - zettel_view, 116 + zettel_view: zettel.into(), 120 117 preview, 121 118 }) 122 119 } ··· 140 137 .await? 141 138 .context("Unknown Behaviour, A selected zettel got deleted somehow.")?; 142 139 143 - self.zettel_view = zettel.into(); 144 - 145 140 self.preview = zettel.content(&kh.index).clone().into(); 141 + drop(kh); 146 142 147 - drop(kh); 143 + self.zettel_view = zettel.into(); 148 144 149 145 Ok(()) 150 146 }
-1
src/types/kasten.rs
··· 34 34 /// at that path. 35 35 pub async fn instansiate(root: impl Into<PathBuf>) -> Result<Self> { 36 36 let root = root.into(); 37 - 38 37 let db_conn_string = format!( 39 38 "sqlite://{}", 40 39 root.clone()
+8
src/types/zettel/id.rs
··· 96 96 .expect("Should be able to parse the test path just file"); 97 97 98 98 assert_eq!(id.0, "abcdef".into()); 99 + 100 + let path = PathBuf::from("/what/the/fuck/are/you/abcdef.md"); 101 + 102 + let id: ZettelId = path 103 + .try_into() 104 + .expect("Should be able to parse the test path just file"); 105 + 106 + assert_eq!(id.0, "abcdef".into()); 99 107 } 100 108 }