platers / obsidian-linter

An Obsidian plugin that formats and styles your notes with a focus on configurability and extensibility.
https://platers.github.io/obsidian-linter/
MIT License
1.24k stars 81 forks source link

FR: Handle Dendron Style Filenames in `YAML Title` #738

Open nbbaier opened 1 year ago

nbbaier commented 1 year ago

Is Your Feature Request Related to a Problem? Please Describe.

Not a problem, but a use case. I am currently trying to migrate my Dendron notes to Obsidian. Dendron file names encode hierarchy along with title. So the file foo.bar.md has the title "bar" and the file foo.bar.baz.md has the title "baz". Currently it's not possible to lint to these titles and this would be nice to be able to do automatically.

Describe the Solution You'd Like

It would be great to introduce some kind of regex (or other type of pattern matching) mode for YAML title linting. Using the regex route on the above example file names, this find/replace would work to derive the correct titles:

foo.bar.md -> bar
foo.bar.baz.md -> baz

This would also allow users to insert arbitrary strings into their titles based on filenames:

foo.bar.md -> hello bar
foo.bar.baz.md -> hello baz
pjkaufman commented 1 year ago

@nbbaier , by chance does custom Regex not handle this scenario? You would need to be careful not to have any comments in your YAML, but the regex should work.