feat(docs): add developer guide

This commit is contained in:
Elian Doran
2025-04-12 01:36:03 +03:00
parent 21e84dd95e
commit d2a1655de5
105 changed files with 7098 additions and 11 deletions

View File

@@ -0,0 +1,15 @@
# CSS
In `doRender()`:
```plain
this.cssBlock(`#my-widget {
position: absolute;
bottom: 40px;
left: 60px;
z-index: 1;
}`)
```
* * *
Reference: [https://trilium.rocks/X7pxYpiu0lgU](https://trilium.rocks/X7pxYpiu0lgU)

View File

@@ -0,0 +1,32 @@
# Right pane widget
* `doRender` must not be overridden, instead `doRenderBody()` has to be overridden.
* `parentWidget()` must be set to `“rightPane”`.
* `widgetTitle()` getter can optionally be overriden, otherwise the widget will be displayed as “Untitled widget”.
```plain
const template = `<div>Hi</div>`;
class ToDoListWidget extends api.RightPanelWidget {
get widgetTitle() {
return "Title goes here";
}
get parentWidget() { return "right-pane" }
doRenderBody() {
this.$body.empty().append($(template));
}
async refreshWithNote(note) {
this.toggleInt(false);
this.triggerCommand("reEvaluateRightPaneVisibility");
this.toggleInt(true);
this.triggerCommand("reEvaluateRightPaneVisibility");
}
}
module.exports = new ToDoListWidget();
```
The implementation is in `src/public/app/widgets/right_panel_widget.js`.