mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
Updated Sharing (markdown)
parent
05b23df6ae
commit
0f831901a4
11
Sharing.md
11
Sharing.md
@ -39,7 +39,16 @@ The default shared page is pretty rudimentary. In case you want to style it more
|
|||||||
|
|
||||||
It's possible to inject a JavaScript note to the shared note using `~shareJs` relation.
|
It's possible to inject a JavaScript note to the shared note using `~shareJs` relation.
|
||||||
|
|
||||||
In case you want to access e.g. attributes or traverse the tree in the linked JavaScript note, you can use the API available through global [`fetchNote(noteId = current)` function](https://github.com/zadam/trilium/blob/master/src/public/app/share.js).
|
In case you want to access e.g. attributes or traverse the tree in the linked JavaScript note, you can use the API available through global [`fetchNote(noteId = current)` function](https://github.com/zadam/trilium/blob/master/src/public/app/share.js), e.g.:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const currentNote = await fetchNote();
|
||||||
|
const parentNote = await fetchNote(currentNote.parentNoteIds[0]);
|
||||||
|
|
||||||
|
for (const attr of parentNote.attributes) {
|
||||||
|
console.log(attr.type, attr.name, attr.value);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Creating human-readable URL aliases
|
### Creating human-readable URL aliases
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user