FileManager.insertIntoFile method
FileManager › insertIntoFile
Unofficial
Insert text into a file, or into one heading's section of it.Signature:
insertIntoFile(file: TFile, text: string, position?: 'append' | 'prepend', heading?: string, spacing?: 'auto' | 'inline' | 'newline'): Promise<void>Parameters:
| Parameter | Type | Description |
|---|---|---|
| file | TFile | The file to insert into. |
| text | string | The text to insert. |
| position? | 'append' | 'prepend' | Where to insert the text. Defaults to 'append'. |
| heading? | string | The heading whose section receives the text. Throws when the note has no such heading. |
| spacing? | 'auto' | 'inline' | 'newline' | What separates the inserted text from the existing text: nothing, a line break, or ('auto', the default) a blank line unless one is already there. |
Returns: Promise<void> — A promise that resolves when the text is inserted.