Skip to content

Instantly share code, notes, and snippets.

@MarceloCajueiro
Created December 26, 2022 14:27
Show Gist options
  • Save MarceloCajueiro/e00c637150da95fd33f8969d0eca5598 to your computer and use it in GitHub Desktop.
Save MarceloCajueiro/e00c637150da95fd33f8969d0eca5598 to your computer and use it in GitHub Desktop.
Obsidian + Meta bind + Templater: load options from file when use a template.

Breakfast Dinner Lunch Take out the garbage Wash the dishes

async function get_options(file) {
const options_file = app.vault.getAbstractFileByPath(file);
const result = await app.vault.read(options_file);
return result
.split("\n")
.map((option) => `option(${option})`)
.join(", ");
}
module.exports = get_options;

Domestic tasks

INPUT[multi_select(
  <% tp.user.meta_bind_options("journals/_props/domestic_tasks.md") %>
):Domestic_tasks]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment