Replace In Note
This button action allows you to replace a specified line range in the current note with new text or a Templater template.
interface ReplaceInNoteButtonAction { type: 'replaceInNote'; fromLine: number | RelativeLineNumberExpression; // the line to start replacing from toLine: number | RelativeLineNumberExpression; // the line to stop replacing at replacement: string; // the replacement text or path to replacement Templater template templater?: boolean; // whether the replacement is a Templater template}
If templater
is true
, the replacement
field is treated as a path to a Templater template.
If templater
is false
or not specified, the replacement
field is treated as plain text.
This button action supports relative line numbers.
Example
Section titled “Example”This example replaces lines 3-5 in the current note with the text following text.
sometextwow
```meta-bind-buttonstyle: primarylabel: Replace in Noteaction: type: "replaceInNote" fromLine: 3 toLine: 5 replacement: "some\ntext\nwow"```