-
Hello, I'm trying to get RenderNotes working, and I have some of the basic functionality understood (and I've been able to get manually run scripts that parse through tons of notes to run code and set contents which... is slow). However, I don't know how to access the note being rendered in order to access it's properties and hierarchy. I'd preffer to have notes with different attributes all pointing to the same script (DRY) rather than writing a script for each renderNote (WET). api.currentNote points to the script being run, not the note being rendered. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can get the current note through |
Beta Was this translation helpful? Give feedback.
You can get the current note through
api.getActiveContextNote()
when trying to make a single render source for multiple render notes. That's what I do for Trilium-SingleFile check here: https://github.com/rauenzi/Trilium-SingleFile/blob/main/static/renderer.js#L48