Active File Resource¶
ActiveFileResource(client)
¶
Bases: ContentResource
Operations on the currently active (open) file in Obsidian.
Source code in src/aiobsidian/rest/_base.py
get(*, content_type=ContentType.MARKDOWN)
async
¶
Get the content of the active file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content_type
|
ContentType
|
Desired response format. Use
|
MARKDOWN
|
Returns:
| Type | Description |
|---|---|
str | NoteJson | DocumentMap
|
File content as |
str | NoteJson | DocumentMap
|
depending on the requested content type. |
Source code in src/aiobsidian/rest/active.py
update(content)
async
¶
Replace the entire content of the active file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str
|
New Markdown content for the file. |
required |
Source code in src/aiobsidian/rest/active.py
append(content)
async
¶
Append content to the end of the active file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str
|
Markdown content to append. |
required |
patch(content, *, operation, target_type, target, target_delimiter='::')
async
¶
Patch a specific section of the active file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str
|
Content to insert or replace. |
required |
operation
|
PatchOperation
|
How to apply the content ( |
required |
target_type
|
TargetType
|
What to target ( |
required |
target
|
str
|
The target identifier. |
required |
target_delimiter
|
str
|
Delimiter for nested targets. |
'::'
|