Note kit command

section.move

Move a section

Moves the section at a heading path or line, with its subsections, before, after, or into the start or end of another section (`toHeading` or `toLine`); a section cannot move into itself.

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

Parameters

Parameters of section.move
NameTypeRequiredDescription
headingstring[]noThe heading's path from the top, each element a heading's plain text, for example ["Plan", "Risks"]; or give line.
lineintegernoThe heading's line, from 1, instead of heading.
position"before" | "after" | "start" | "end"yesWhere, relative to that heading's section.
sectionstringnoThe section's id from outline.read ("section:3"), instead of heading or line: it names the same section after a rename or a move, for as long as the note stays open.
toHeadingstring[]noThe heading to move it next to, by path.
toLineintegernoThe heading to move it next to, by line, instead of toHeading.
toSectionstringnoThe section to move it next to, by its id from outline.read, instead of toHeading or toLine.

Call through note_run

text
note_run {
  "path": "<file>.md",
  "steps": [{ "command": "section.move", "params": { "position": <"before" | "after" | "start" | "end"> } }]
}

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

Result

Result of section.move
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": {
    "heading": {
      "description": "The heading's path from the top, each element a heading's plain text, for example [\"Plan\", \"Risks\"]; or give line.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "line": {
      "description": "The heading's line, from 1, instead of heading.",
      "type": "integer"
    },
    "position": {
      "description": "Where, relative to that heading's section.",
      "enum": [
        "before",
        "after",
        "start",
        "end"
      ],
      "type": "string"
    },
    "section": {
      "description": "The section's id from outline.read (\"section:3\"), instead of heading or line: it names the same section after a rename or a move, for as long as the note stays open.",
      "type": "string"
    },
    "toHeading": {
      "description": "The heading to move it next to, by path.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "toLine": {
      "description": "The heading to move it next to, by line, instead of toHeading.",
      "type": "integer"
    },
    "toSection": {
      "description": "The section to move it next to, by its id from outline.read, instead of toHeading or toLine.",
      "type": "string"
    }
  },
  "required": [
    "position"
  ],
  "type": "object"
}

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