trilium_alchemy.core.note.content
¶
Class index¶
Canonical
Interface to note’s content. |
|
Override |
Symbols¶
- class trilium_alchemy.core.note.content.Content(entity: BaseEntity)¶
Bases:
trilium_alchemy.core.note.extension.NoteStatefulExtension
Interface to note’s content.
Access as
Note.content
, a descriptor mapping to an instance of this class.The expected type depends on
Note.is_string
:True
: get/setstr
False
: get/setbytes
Get or set content as follows:
note.content = "<p>Hello, world!</p>" assert note.content == "<p>Hello, world!</p>"
Todo
Helper
Note.file
to set content from file, automatically settingmime
and#originalFilename
.Example:
note.file = "assets/my_content.html"
- class trilium_alchemy.core.note.content.ContentDescriptor(attr: str)¶
Bases:
trilium_alchemy.core.entity.ExtensionDescriptor
Override
ExtensionDescriptor.__get__
to return the content itself viaContent._get
.