mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-27 17:56:25 +02:00
feat: enhance Obsidian plugin schema with HeadingRef class
This commit is contained in:
parent
1d324f169f
commit
6eeaa2db4d
4 changed files with 38 additions and 3 deletions
|
|
@ -21,6 +21,13 @@ class _PluginBase(BaseModel):
|
|||
model_config = _PLUGIN_MODEL_CONFIG
|
||||
|
||||
|
||||
class HeadingRef(_PluginBase):
|
||||
"""One markdown heading extracted from Obsidian metadata cache."""
|
||||
|
||||
heading: str
|
||||
level: int = Field(ge=1, le=6)
|
||||
|
||||
|
||||
class NotePayload(_PluginBase):
|
||||
"""One Obsidian note as pushed by the plugin (the source of truth)."""
|
||||
|
||||
|
|
@ -36,7 +43,7 @@ class NotePayload(_PluginBase):
|
|||
|
||||
frontmatter: dict[str, Any] = Field(default_factory=dict)
|
||||
tags: list[str] = Field(default_factory=list)
|
||||
headings: list[str] = Field(default_factory=list)
|
||||
headings: list[HeadingRef] = Field(default_factory=list)
|
||||
resolved_links: list[str] = Field(default_factory=list)
|
||||
unresolved_links: list[str] = Field(default_factory=list)
|
||||
embeds: list[str] = Field(default_factory=list)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue