append_to_note
Add content to the end of an existing note in Obsidian vaults. Specify the note path and text to append, with optional newline formatting.
Instructions
Append content to the end of an existing note
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Relative path to the note | |
| content | Yes | Content to append | |
| ensureNewline | No | Ensure content starts on a new line (default: true) |
Implementation Reference
- src/lib/vault.ts:85-94 (handler)The actual logic for appending content to a file.
export async function appendToNote( vaultPath: string, relativePath: string, content: string, ): Promise<void> { const fullPath = resolveVaultPath(vaultPath, relativePath); const existing = await fs.readFile(fullPath, "utf-8"); const separator = existing.endsWith("\n") ? "" : "\n"; await fs.writeFile(fullPath, existing + separator + content, "utf-8"); }