Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```dataviewjs
- // Show random definition
- let definitionList = [];
- let cardtitleList = [];
- let fileList = [];
- let query = dv.pages()
- .where(page => page.cardtitle)
- .where(page => page.cardtitle != "N/A");
- for (q of query) {
- fileList.push(q.file.name);
- definitionList.push(q.definition);
- cardtitleList.push(q.cardtitle);
- };
- // o = once per day
- // H = once per hour
- // m = once per minute
- // s = once per second
- const rnd = DateTime.now().toFormat("o") % cardtitleList.length;
- dv.span('[[' + fileList[rnd] + '|' + cardtitleList[rnd] + ']]' + '<br><br>'+ definitionList[rnd]);
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement