obsidian-linter icon indicating copy to clipboard operation
obsidian-linter copied to clipboard

FR: YAML Title Alias should Allow Users to Specify Key for Where to Store Title as a Reference

Open platon-ivanov opened this issue 3 years ago • 4 comments

Problem description

Under YAML Title Alias there is the setting to "Use the YAML key linter-yaml-title-alias to help with filename and heading changes". Currently it creates the key that has identical contents to the title key, so every file has 2 identical keys.

Possible solution

Is it possible that instead of linter-yaml-title-alias it would use the title key?

platon-ivanov avatar Dec 20 '22 17:12 platon-ivanov

I don't think I follow this request since you can turn off the use of the key linter-yaml-title-alias. Is there a reason you want to keep the value of the key when you are saying that you don't want that key?

pjkaufman avatar Dec 20 '22 22:12 pjkaufman

The purpose of linter-yaml-title-alias is to keep track of which alias to automatically change when the title of the document changes, which is very useful.

image

This key is, however, always identical to the YAML title key, also provided by the plugin. This makes it seem like linter-yaml-title-alias is redundant.

platon-ivanov avatar Dec 20 '22 23:12 platon-ivanov

That may be the case however they are two separate rules that allow for what you are referring to. Enabling both at the same time would then be able to cause unexpected results and would not be something that could be easily fixed. I don't see a problem with making the key used user defined as long as it is sensible that the user should know that using the two rules in conjunction can cause unexpected bugs.

Does that make sense or is this something that you think would be prone to bugs?

pjkaufman avatar Dec 20 '22 23:12 pjkaufman

Unfortunately I don't know the inner workings of the plugin, so it's difficult for me to judge how bug-prone any of the solutions would be. As a user, however, if there was a possibility to change the tag from linter-yaml-title-alias, I would try changing it to title, turning off the YAML title settings and hope that I would get an automatic title key in conjunction with an automated alias.

platon-ivanov avatar Dec 20 '22 23:12 platon-ivanov

The change for this has been merged into master and should be in the next release. Please let us know if there are issues with it in either place. Thanks!

pjkaufman avatar Mar 22 '24 18:03 pjkaufman