Until now, I stored all my metadata with a list of inline fields (key:: value) directly in the .md file.
Now with the (amazing) new properties feature in obsmd 1.4, I want to move all of my existing metadata in to the frontmatter and be compatible with the properties manager.
Has somebody found a way to make this an automated process?
So dedecting and moving inline fields in to the frontmatter, changing the double colon to a single one and wraping the internal links with quotation marks.
The Linter plug-in can be used to move tags into the frontmatter, but until now lacks the ability for inline fields.
This could probably be achieved with a script, but unfortunately I lack any programming ability I think I’m not the only one who had this method for metadata till now, so I think it could be useful not just for me!
Post-processing regex changes can also be done in VSCode/Notepad++, etc. Must toggle regex on.
Replace: key: "$1"
If you have a few different keys, it’s easy to do, but if you have dozens or hundreds of different keys, you need to capture each key with regular expression again.
Hey @gino_m !
Yes, I had thought of doing find and replace, but it may take me too much time as I already have over a hundred keys. I think py-obsidian, or using obsidian linter are the best tools. But seems that none supports this move yet…
I could have given you this solution straight away, but I don’t see your files. This will make replacements on all lines in and outside of your YAML.
A more stringent way to target YAML keys only would be to go for keys starting with a lowercase character – that’s if your keys are all lowercase strings (as is the case in my vault). Then:
Replace: $1: "$2"
…in which case a main body line such as– See here: [[somefilename]]
…won’t be changed to: See here: "[[somefilename]]"
Another way would be to target single-string keys (my keys are never two or three words and are always lowercase).
In the following page, I make targets for various cases for 2 and 3-string variations as well with the OR operator:
Should be okay to use.
(Make a backup of your vault and see what happens. Then report back, if you want.)