feat: add option for disabling frontmatter updates - #816
Conversation
adamtajti
left a comment
There was a problem hiding this comment.
I'm not a maintainer, but I skimmed through a couple of pull requests before planning to create one of my own and I left a couple of comments here that could be of use to improve this work.
| end | ||
|
|
||
| --- Determines whether a note's frontmatter is managed by obsidian.nvim. | ||
| --- Determines whether a note's frontmatter is created by obsidian.nvim. |
There was a problem hiding this comment.
I think that this term should be kept as managed if both the update and the create functionality is going to be supported.
| ---@field follow_url_func fun(url: string)|? | ||
| ---@field follow_img_func fun(img: string)|? | ||
| ---@field note_frontmatter_func (fun(note: obsidian.Note): table)|? | ||
| ---@field disable_frontmatter (fun(fname: string?): boolean)|boolean|? |
There was a problem hiding this comment.
I think that this is a breaking change. The pull request misses an update to the CHANGELOG.md, but I assume that this would warrant a major version bump.
The other approach would be to prioritize disable_frontmatter. If it's set to true, or if it's a function that returns true, then that should make disable_frontmatter_creation and disable_frontmatter_update default to true as well, even if they are configured.
| disable_frontmatter = false, | ||
| update_frontmatter = false, |
There was a problem hiding this comment.
- The
ClientOptsdocumentation update seems to signal thatdisable_frontmatteris no longer supported, yet it's set to false. - The
ClientOptsdocumentation doesn't seem to mentionupdate_frontmatterat all, instead it hasdisable_frontmatter_creationanddisable_frontmatter_update. - The
README.mdfile still referencesdisable_frontmatterand it doesn't mentions the new settings.
Oh wow. Thank you so much! I've actually moved away from this plugin completely. I prefer something that is a simple cli tool with neovim integration instead. Currently developing a homebaked tool. This plugin unfortunately destroys the frontmatter for my other notes since it does not support yaml tags; this distrupts my workflow personally. Regardless, thank you. |
While I do enjoy Obsidian creating yaml frontmatter for me, I've found strange issues with the fronmatter updating functionality. I've added the option to disable it.