Last active
May 24, 2023 05:40
-
-
Save hungsu/9ccdc3ace1408608c2f1f117b6de59af to your computer and use it in GitHub Desktop.
One random note from my to read list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var seedNotes = dv.pages('"Private/Urgent"').file.filter(function(note){return note.name !== "_Index"}) | |
function getRandomInt(min, max) { | |
min = Math.ceil(min); | |
max = Math.floor(max); | |
return Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive | |
} | |
var randomNoteIndex = getRandomInt(0, seedNotes.length) | |
var randomNote = seedNotes.filter(function(note,index){return index == randomNoteIndex}) | |
dv.paragraph("Embed below:"); | |
console.log(randomNote) | |
dv.paragraph("![["+randomNote.values[0].path+"]]") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment