Note kit command
text.read
Read the text
Answers the note's raw Markdown (front matter included) and its length, or only the part between `from` and `to` (text positions from 0). Use it to read exact text before editing by position.
- Kit
- Note 0.3.0 (Markdown (.md))
- Changes the document
- no
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
from | integer | no | Where to start; 0 by default. |
to | integer | no | Where to stop (exclusive); the end by default. |
unit | "scalar" | "utf16" | no | How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them. |
Call through note_run
text
note_run {
"path": "<file>.md",
"steps": [{ "command": "text.read" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: from, to, unit. note_run answers the step’s result in completed[i].result.
Result
| Name | Type | Required | Description |
|---|---|---|---|
length | integer | yes | The whole note's length, in the request's unit. |
text | string | yes | The text between from and to (the whole note by default), front matter included. |
Result JSON Schema
json
{
"additionalProperties": false,
"properties": {
"length": {
"description": "The whole note's length, in the request's unit.",
"type": "integer"
},
"text": {
"description": "The text between from and to (the whole note by default), front matter included.",
"type": "string"
}
},
"required": [
"length",
"text"
],
"type": "object"
}Parameter schema
json
{
"additionalProperties": false,
"properties": {
"from": {
"description": "Where to start; 0 by default.",
"type": "integer"
},
"to": {
"description": "Where to stop (exclusive); the end by default.",
"type": "integer"
},
"unit": {
"default": "scalar",
"description": "How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them.",
"enum": [
"scalar",
"utf16"
],
"type": "string"
}
},
"type": "object"
}Generated from kition-sdk packages/script/kits/note.ts and the kit itself (kition-note@69e14d9). As data: commands.jsonl.