Note kit command

table.setCell

Set a table cell

Sets one cell's text: `table` and `column` count from 0, `row` 0 is the header and body rows count from 1. Pass `expected` with the current text so a stale cell fails.

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

Parameters

Parameters of table.setCell
NameTypeRequiredDescription
columnintegeryesThe column, from 0.
expectedstringnoThe cell's text now; the command is refused when it differs.
rowintegeryesThe row, 0 for the header row.
tableintegeryesThe table's index in the note, from 0 (document order).
textstringyesThe cell's new text (inline Markdown, one line).

Call through note_run

text
note_run {
  "path": "<file>.md",
  "steps": [{ "command": "table.setCell", "params": { "column": <integer>, "row": <integer>, "table": <integer>, "text": <string> } }]
}

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

Result

Result of table.setCell
NameTypeRequiredDescription
changedbooleanyesWhether the note's text changed (false when it already read so).
Result JSON Schema
json
{
  "additionalProperties": false,
  "properties": {
    "changed": {
      "description": "Whether the note's text changed (false when it already read so).",
      "type": "boolean"
    }
  },
  "required": [
    "changed"
  ],
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "column": {
      "description": "The column, from 0.",
      "type": "integer"
    },
    "expected": {
      "description": "The cell's text now; the command is refused when it differs.",
      "type": "string"
    },
    "row": {
      "description": "The row, 0 for the header row.",
      "type": "integer"
    },
    "table": {
      "description": "The table's index in the note, from 0 (document order).",
      "type": "integer"
    },
    "text": {
      "description": "The cell's new text (inline Markdown, one line).",
      "type": "string"
    }
  },
  "required": [
    "column",
    "row",
    "table",
    "text"
  ],
  "type": "object"
}

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