Add per-vault periodic notes config, fix version/print-default bugs, stop tracking build artifacts
- onyx periodic --view/--edit: configure folder/format/template per note type, independent of Obsidian's Daily Notes / Periodic Notes plugin state - fix: weekly/monthly/quarterly/yearly notes no longer silently inherit the daily note's folder/template when no plugin config exists - fix: quarterly notes now resolve the real quarter number instead of a literal 'Q' - fix: onyx --version now works at the root command group; remove the redundant no-op 'version' subcommand - fix: print-default no longer dumps the raw vault config dict for long-form vault entries - expand --help text across periodic/create/set-default commands - add .gitignore; stop tracking build/, dist/, __pycache__/, .idea/, .vscode/
This commit is contained in:
1 parent
d13e377aba
commit
0dddb57d76
30 files changed
+457
-21318
No files matched your search
@@ -96,14 +96,43 @@ onyx quarterly --next # opens next quarter's note
|
||||
onyx yearly --previous # opens last year's note
|
||||
```
|
||||
|
||||
**Filename formats:**
|
||||
**Default filename formats** (used when nothing else is configured):
|
||||
- Daily: `YYYY-MM-DD.md`
|
||||
- Weekly: `YYYY-WWW.md` (ISO week, e.g. `2025-W48.md`)
|
||||
- Monthly: `YYYY-MM.md`
|
||||
- Quarterly: `YYYY-QX.md` (e.g. `2025-Q4.md`)
|
||||
- Yearly: `YYYY.md`
|
||||
|
||||
The correct filename is always generated automatically, regardless of your plugin settings.
|
||||
Folder, filename format, and template for each note type are resolved in this order:
|
||||
1. onyx's own config, set via `onyx periodic` (see below)
|
||||
2. Obsidian's Periodic Notes plugin, or the core Daily Notes plugin for daily notes
|
||||
3. The built-in defaults above
|
||||
|
||||
Each note type is resolved independently — configuring (or not configuring) one type
|
||||
never affects another. See [Configuring Periodic Notes](#configuring-periodic-notes) to
|
||||
set your own folders/formats/templates, especially for vaults without the Periodic Notes
|
||||
plugin installed (daily/weekly/monthly/quarterly/yearly notes not stored in the vault root).
|
||||
|
||||
### Configuring Periodic Notes
|
||||
|
||||
```bash
|
||||
# View the resolved settings for a note type
|
||||
onyx periodic --type weekly --view
|
||||
|
||||
# Set your own folder / format / template for a note type
|
||||
onyx periodic --type weekly --edit --folder "periodic/weekly" --format "YYYY-[W]WW" --template "resources/template/weekly-note.md"
|
||||
|
||||
# Any subset of --folder / --format / --template can be set at once
|
||||
onyx periodic --type monthly --edit --folder "periodic/monthly"
|
||||
|
||||
# Configure a specific vault
|
||||
onyx periodic --type weekly --edit --folder "periodic/weekly" --vault "work"
|
||||
```
|
||||
|
||||
`--format` uses moment.js-style tokens (`YYYY`, `MM`, `DD`, `[W]WW`, `[Q]Q`, ...), matching
|
||||
what Obsidian's own daily-notes/periodic-notes settings use. `--folder` and `--template` are
|
||||
paths relative to the vault root.
|
||||
|
||||
|
||||
### Creating & Editing Notes
|
||||
|
||||
@@ -222,11 +251,20 @@ python -m pytest --cov=src tests/
|
||||
|
||||
## Configuration
|
||||
|
||||
The CLI stores vault configuration in `~/.onyx-cli/config.yaml`. You can manually edit this file to manage vaults:
|
||||
The CLI stores vault configuration in `~/.onyx-cli/config.yaml`. You can manually edit this file to manage vaults, or use `onyx set-default` and `onyx periodic` to edit it for you:
|
||||
|
||||
```yaml
|
||||
default_vault: my-vault
|
||||
vaults:
|
||||
my-vault: /path/to/vault
|
||||
work: /path/to/work/vault
|
||||
my-vault: /path/to/vault # short form: just a path
|
||||
work: # long form: path plus optional settings
|
||||
path: /path/to/work/vault
|
||||
path_prefix: /path/to/prefix
|
||||
periodic_notes:
|
||||
weekly:
|
||||
folder: periodic/weekly
|
||||
format: YYYY-[W]WW
|
||||
template: resources/template/weekly-note.md
|
||||
monthly:
|
||||
folder: periodic/monthly
|
||||
```
|
||||
Reference in new issue
Block a user