Created
April 28, 2022 01:20
-
-
Save jpbruckler/e9b53dd48545a9588a9dff2ebc7ce013 to your computer and use it in GitHub Desktop.
Obsidian.md Templater plugin pattern for multiple choices in a suggester.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
// From: https://forum.obsidian.md/t/quickadd-plugin/20032/70 | |
const responses = []; | |
let chc = ["Choice 1", "Choice 2", "Choice 3"] | |
if (!chc.includes("Done")) { | |
chc.push("Done"); | |
} | |
// Multiple selection suggester pattern | |
let r; | |
while (r !== "Done") { | |
r = await tp.system.suggester(chc,chc); | |
if (r !== "Done") { | |
responses.push(r) | |
chc = chc.map(s => s === r ? `✅ ${s}` : s); | |
} | |
} | |
-%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment