Keyword Handler
unlistedby Peter Kaufman
Takes keywords and adds them to the frontmatter by looking at a specific YAML key and using that value as the keyword for the file.
★ 4 starsUpdated 5mo agoMIT
Keyword Handler
This plugin is a pretty basic keyword handler for my own personal needs to automate a task that I do manually to save me some time. If it is useful for you, feel free to go ahead and use it.
How it works
The plugin adds a command on load called Add Keywords to YAML. This command is an editor command. It does the following:
- Gets the text for the current editor
- Gets the current
keywordsvalue from the frontmatter if there is one - Gets all markdown links in the current file from the cached metadata
- Gets the file and then the file metadata cache to check for the
keywordkey's value in the referenced file - If the keyword has any spaces in it, it has double quotes used to escape the value
- If the keyword does not already exist in the list, it gets added
- Adds the keywords to the frontmatter if the value has changed
How to use
- Clone this repo.
- Make sure your NodeJS is at least v16 (
node --version). npm ioryarnto install dependencies.npm run devto start compilation in watch mode.
Manually installing the plugin
- Copy over
main.jsandmanifest.jsonto your vaultVaultFolder/.obsidian/plugins/your-plugin-id/.
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.