trilium_alchemy.lib.extension_types

Defines more specific classes to assist in the development of extensions.

Class index

Canonical

BaseTemplateNote

Defines a template.

BaseWorkspaceTemplateNote

Defines a workspace template.

BaseAppCssNote

Defines a CSS note with label #appCss.

BaseThemeNote

Defines a theme.

BaseWidgetNote

Defines a widget.

BaseFrontendScriptNote

Defines a frontend script.

BaseBackendScriptNote

Defines a backend script.

Symbols

class trilium_alchemy.lib.extension_types.BaseTemplateNote

Bases:

trilium_alchemy.lib.extension_types._BaseTemplateNote

Aliases:

trilium_alchemy.BaseTemplateNote
trilium_alchemy.lib.BaseTemplateNote

Defines a template.

Added by decorators:

  • #template

idempotent

True

Inherited from: trilium_alchemy.lib.extension_types._BaseTemplateNote

classmethod new_instance(*args, **kwargs)

Inherited from: trilium_alchemy.lib.extension_types._BaseTemplateNote

Create new note with ~template relation to this note, passing through constructor args.

class trilium_alchemy.lib.extension_types.BaseWorkspaceTemplateNote

Bases:

trilium_alchemy.lib.extension_types._BaseTemplateNote

Aliases:

trilium_alchemy.BaseWorkspaceTemplateNote
trilium_alchemy.lib.BaseWorkspaceTemplateNote

Defines a workspace template.

Added by decorators:

  • #workspaceTemplate

idempotent

True

Inherited from: trilium_alchemy.lib.extension_types._BaseTemplateNote

classmethod new_instance(*args, **kwargs)

Inherited from: trilium_alchemy.lib.extension_types._BaseTemplateNote

Create new note with ~template relation to this note, passing through constructor args.

class trilium_alchemy.lib.extension_types.BaseAppCssNote

Bases:

trilium_alchemy.lib.note_types.CssNote

Aliases:

trilium_alchemy.BaseAppCssNote
trilium_alchemy.lib.BaseAppCssNote

Defines a CSS note with label #appCss.

Use BaseDeclarativeNote.content_file to set content from file.

Added by decorators:

  • #appCss

singleton

True

mime_

"text/css"

Inherited from: trilium_alchemy.lib.note_types.CssNote

icon

"bx bxs-file-css"

Inherited from: trilium_alchemy.lib.note_types.CssNote

note_type_

"code"

Inherited from: trilium_alchemy.lib.note_types.CodeNote

class trilium_alchemy.lib.extension_types.BaseThemeNote

Bases:

trilium_alchemy.lib.note_types.CssNote

Aliases:

trilium_alchemy.BaseThemeNote
trilium_alchemy.lib.BaseThemeNote

Defines a theme.

Use BaseDeclarativeNote.content_file to set content from file.

Adds label: #appTheme=BaseThemeNote.theme_name

  • If None, defaults to class name

singleton

True

theme_name: str | None

None

Name of theme, or None to use class name.

mime_

"text/css"

Inherited from: trilium_alchemy.lib.note_types.CssNote

icon

"bx bxs-file-css"

Inherited from: trilium_alchemy.lib.note_types.CssNote

note_type_

"code"

Inherited from: trilium_alchemy.lib.note_types.CodeNote

class trilium_alchemy.lib.extension_types.BaseWidgetNote

Bases:

trilium_alchemy.lib.note_types.JsFrontendNote

Aliases:

trilium_alchemy.BaseWidgetNote
trilium_alchemy.lib.BaseWidgetNote

Defines a widget.

Added by decorators:

  • #widget

singleton

True

mime_

"application/javascript;env=frontend"

Inherited from: trilium_alchemy.lib.note_types.JsFrontendNote

icon

"bx bxl-javascript"

Inherited from: trilium_alchemy.lib.note_types.JsFrontendNote

note_type_

"code"

Inherited from: trilium_alchemy.lib.note_types.CodeNote

class trilium_alchemy.lib.extension_types.BaseFrontendScriptNote

Bases:

trilium_alchemy.lib.note_types.JsFrontendNote

Aliases:

trilium_alchemy.BaseFrontendScriptNote
trilium_alchemy.lib.BaseFrontendScriptNote

Defines a frontend script.

Example:

class MyFunction(FrontendScript):
    content_file = 'assets/myFunction.js'

@children(MyFunction)
class MyWidget(Widget): pass
singleton

True

mime_

"application/javascript;env=frontend"

Inherited from: trilium_alchemy.lib.note_types.JsFrontendNote

icon

"bx bxl-javascript"

Inherited from: trilium_alchemy.lib.note_types.JsFrontendNote

note_type_

"code"

Inherited from: trilium_alchemy.lib.note_types.CodeNote

class trilium_alchemy.lib.extension_types.BaseBackendScriptNote

Bases:

trilium_alchemy.lib.note_types.JsBackendNote

Aliases:

trilium_alchemy.BaseBackendScriptNote
trilium_alchemy.lib.BaseBackendScriptNote

Defines a backend script.

Example:

class UpdateSomeOtherAttribute(BackendScript):
    content_file = 'assets/updateSomeOtherAttribute.js'

@relation('runOnAttributeCreation', UpdateSomeOtherAttribute)
@relation('runOnAttributeChange', UpdateSomeOtherAttribute)
class MyTemplate(Template): pass
singleton

True

mime_

"application/javascript;env=backend"

Inherited from: trilium_alchemy.lib.note_types.JsBackendNote

icon

"bx bxl-javascript"

Inherited from: trilium_alchemy.lib.note_types.JsBackendNote

note_type_

"code"

Inherited from: trilium_alchemy.lib.note_types.CodeNote