Hoi there, noob here. Thanks for taking a look!
What I’m trying to do
I am attempting to generate a file path to a random note out of a specific folder, which I will then place in a “Random Note” link.
i.e., [[ Root Folder Which Never Changes/Path/to/random/note.md | Random Note ]]
This link to a random note will be lovingly placed in a card along with all of its buddies.
Things I have tried
Templater and Dataview have been my sword and shield, and both to tantalizingly close effect. I have a great sauce from this very forum that has allowed me to create a block of DataviewJS to generate a Random Note path with a consistent “Random Note” name override pretty effectively.
let pages = dv.pages('"01 - The World"')
let random = Math.floor(Math.random() * (pages.length - 1))
let randomNote = pages[random].file.name
dv.paragraph("[[" + randomNote + "| Random Note]]")
As for Templater, I can make all sorts of great Templates for pages, sure, but the user-defined functions remain beyond me. (For now.)
I’ve got all the ingredients for a spectacularly nutritious randomizer. I just don’t know how to make it stay inline. If you’re willing to help a poor soul out, I’d really appreciate any and all pointers given. If this is impossible, I’ll hear it! Better to know I’m being foolish with the tools than to keep trying, in that case.
TL;DR: Although I know there’s a random note feature in Obsidian, yes, I am being extra.