Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%*
- const dv = this.app.plugins.plugins["dataview"].api;
- let keyword = await tp.system.prompt("Look up Definition Card","",true,false);
- keyword = keyword.toLowerCase();
- let query = dv.pages()
- .where(page => page.cardtitle)
- .where(page => page.cardtitle.toLowerCase().includes(keyword));
- if (query.length > 0) {
- let choice = await tp.system.suggester(query.cardtitle, query.cardtitle, false, "Card Title", 15);
- if (choice) {
- let result = dv.pages()
- .where(page => page.cardtitle == choice);
- card = '[[' + result[0].file.name + '|' + choice + ']]';
- tR += '>[!summary] ' + card + '\n>' + result.definition[0];
- }
- }
- %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement