Skip to content

Instantly share code, notes, and snippets.

@jdpilgrim
Created December 5, 2022 17:24
Show Gist options
  • Save jdpilgrim/14018918454329da3460cafa11c5b98f to your computer and use it in GitHub Desktop.
Save jdpilgrim/14018918454329da3460cafa11c5b98f to your computer and use it in GitHub Desktop.
Obsidian tasks within this note
function callout(text, type) {
    const allText = `> [!${type}]\n` + text;
    const lines = allText.split('\n');
    return lines.join('\n> ') + '\n'
}

const query = `
not done
path includes ${dv.current().file.path}
# you can add any number of extra Tasks instructions, for example:
group by heading
`;

dv.paragraph(callout('```tasks\n' + query + '\n```', 'todo'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment