Note kit command

block.read

Read a block

Answers the Markdown of the block carrying the block id `blockId` (`^id`), with its range and first line.

Kit
Note 0.3.0 (Markdown (.md))
Changes the document
no

Parameters

Parameters of block.read
NameTypeRequiredDescription
blockIdstringyesThe block id, without the caret (^).
unit"scalar" | "utf16"noHow 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": "block.read", "params": { "blockId": <string> } }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: unit. note_run answers the step’s result in completed[i].result.

Result

Result of block.read
NameTypeRequiredDescription
fromintegeryesWhere it starts, in the request's unit.
lineintegeryesIts first line, from 1.
markdownstringyesThe Markdown, as the file has it.
tointegeryesWhere it ends (exclusive).
Result JSON Schema
json
{
  "additionalProperties": false,
  "properties": {
    "from": {
      "description": "Where it starts, in the request's unit.",
      "type": "integer"
    },
    "line": {
      "description": "Its first line, from 1.",
      "type": "integer"
    },
    "markdown": {
      "description": "The Markdown, as the file has it.",
      "type": "string"
    },
    "to": {
      "description": "Where it ends (exclusive).",
      "type": "integer"
    }
  },
  "required": [
    "from",
    "line",
    "markdown",
    "to"
  ],
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "blockId": {
      "description": "The block id, without the caret (^).",
      "type": "string"
    },
    "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"
    }
  },
  "required": [
    "blockId"
  ],
  "type": "object"
}

Generated from kition-sdk packages/script/kits/note.ts and the kit itself (kition-note@69e14d9). As data: commands.jsonl.