Minimal checklist options templater template

I absolutely love the Minimal theme, which includes custom todo options (see below). The gotcha is that it’s a little annoying to manually add them in.

I was inspired by a templater theme (sorry, lost the link) for callouts, and edited it for these checkboxes. I assigned it to a hotkey and now use these way more often. Here’s the template for those interested:

<%*
const todos = {
    "- [/]": "incomplete",
    "- [-]": "canceled",
    "- [>]": "forwarded",
    "- [<]": "scheduling",
    "- [\"]": "quote",
    "- [?]": "🟧 question",
    "- [!]": "🟥 important",
    "- [*]": "🟧 star",
    "- [l]": "📍 location",
    "- [b]": "🟥 bookmark",
    "- [i]": "🟦 information",
    "- [S]": "💰 savings",
    "- [I]": "🟦 idea",
    "- [p]": "🟩 pros",
    "- [c]": "🟥 cons",
    "- [f]": "🔥 fire",
    "- [k]": "🟧 key",
    "- [w]": "🎂 win",
    "- [u]": "🟩 up",
    "- [d]": "🟥 down"
};

const typeNames = [];
const typeLabels = [];

Object.keys(todos)
	.sort() // Remove this line to use predefined order.
	.forEach(key => 
		typeNames.push(key) && typeLabels.push(todos[key])
	);

let todoType = await tp.system.suggester(
	typeLabels,
	typeNames,
	false,
	"Select todo type."
);

// Stop here when the prompt was cancelled (ESC).
if (!todoType) {
  return;
}

let todo = await tp.file.selection();
if (!todo) {
	todo = await tp.system.prompt("To Do Text", "");
}
_%>

<% todoType %> <% todo %><%* tp.file.cursor() %>

Checkbox options: