Tags: erikjuhani/basalt
Tags
Improve obsidian config logic (#45) #### [Get all potential obsidian global config locations](a5136b1) > Due to the nature of this functionality being reliant of another > application called Obsidian, we must take into account possible > sandboxed installations on Linux systems (e.g. flatpak, snap). > > Additionally, this global config location can be controlled with an > environment variable called `OBSIDIAN_CONFIG_DIR`, which can be given a > `~` symbol to mark the home directory. The `~` symbol is transformed to > the absolute home directory path. > > The obsidian_global_config_locations() returns all potential directory > paths for Obsidian. > > On macOS and Windows we default to the regular paths defined in the > Obsidian documentation: > > - macOS: /Users/username/Library/Application Support/obsidian > - Windows: %APPDATA%\Obsidian\ > > From this list of returned configs we filter out any paths that do not > exist and then we select the first one, as the returned list is in order > of priority: > > 1. The `OBSIDIAN_CONFIG_DIR` environment variable > 2. User config directory > 3. Flatpak config > 4. Snap config > > If no paths can be certainly determined to be directories we fail with > an error that displays all the configs we tried to access. > > This change should fix #44. #### [Use try_exists in load_from for global Obsidian config](9f5359d) > Previously we naively assumed that the config file exists, now a more > explicit domain error is returned. #### [Remove created field from Note as obsolete](fa17bf6) > The existence of this field could result notes from being read into the > program due to the fact that some systems do not support the file > creation time metadata. > > This functionality was now removed, since it was not in use in > basalt-tui. #### [Return Vec instead of Iterator from notes()](d56f252)
Improve obsidian config logic (#45) #### [Get all potential obsidian global config locations](a5136b1) > Due to the nature of this functionality being reliant of another > application called Obsidian, we must take into account possible > sandboxed installations on Linux systems (e.g. flatpak, snap). > > Additionally, this global config location can be controlled with an > environment variable called `OBSIDIAN_CONFIG_DIR`, which can be given a > `~` symbol to mark the home directory. The `~` symbol is transformed to > the absolute home directory path. > > The obsidian_global_config_locations() returns all potential directory > paths for Obsidian. > > On macOS and Windows we default to the regular paths defined in the > Obsidian documentation: > > - macOS: /Users/username/Library/Application Support/obsidian > - Windows: %APPDATA%\Obsidian\ > > From this list of returned configs we filter out any paths that do not > exist and then we select the first one, as the returned list is in order > of priority: > > 1. The `OBSIDIAN_CONFIG_DIR` environment variable > 2. User config directory > 3. Flatpak config > 4. Snap config > > If no paths can be certainly determined to be directories we fail with > an error that displays all the configs we tried to access. > > This change should fix #44. #### [Use try_exists in load_from for global Obsidian config](9f5359d) > Previously we naively assumed that the config file exists, now a more > explicit domain error is returned. #### [Remove created field from Note as obsolete](fa17bf6) > The existence of this field could result notes from being read into the > program due to the fact that some systems do not support the file > creation time metadata. > > This functionality was now removed, since it was not in use in > basalt-tui. #### [Return Vec instead of Iterator from notes()](d56f252)
PreviousNext