Skip to content

feat: add option for disabling frontmatter updates - #816

Closed
thetwistedlogic wants to merge 1 commit into
epwalsh:mainfrom
thetwistedlogic:main
Closed

feat: add option for disabling frontmatter updates#816
thetwistedlogic wants to merge 1 commit into
epwalsh:mainfrom
thetwistedlogic:main

Conversation

@thetwistedlogic

Copy link
Copy Markdown

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.

@adamtajti adamtajti left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread lua/obsidian/client.lua
end

--- Determines whether a note's frontmatter is managed by obsidian.nvim.
--- Determines whether a note's frontmatter is created by obsidian.nvim.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this term should be kept as managed if both the update and the create functionality is going to be supported.

Comment thread lua/obsidian/config.lua
---@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|?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread lua/obsidian/config.lua
Comment on lines 55 to +56
disable_frontmatter = false,
update_frontmatter = false,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The ClientOpts documentation update seems to signal that disable_frontmatter is no longer supported, yet it's set to false.
  • The ClientOpts documentation doesn't seem to mention update_frontmatter at all, instead it has disable_frontmatter_creation and disable_frontmatter_update.
  • The README.md file still references disable_frontmatter and it doesn't mentions the new settings.

@thetwistedlogic

Copy link
Copy Markdown
Author

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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants