Skip to content

Instantly share code, notes, and snippets.

@emisjerry
Created October 22, 2021 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emisjerry/287590ee7a23930f0e968a4903a3f3d0 to your computer and use it in GitHub Desktop.
Save emisjerry/287590ee7a23930f0e968a4903a3f3d0 to your computer and use it in GitHub Desktop.
Obsidian QuickAdd macro for selecting YAML tags
module.exports = async function select_tags(params) {
const {app, quickAddApi: {suggester}} = params;
const allTags = Object.keys(app.metadataCache.getTags());
let tag = await suggester(allTags, allTags);
if (!tag) return;
tag = tag.substring(1); // skip the hash symbol
return tag;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment