Note kit command

page.layout

Read the page layout

Answers how the note prints on `letter` or `a4` pages: the page count, where each block lands (page, x, y, width, height in points), blocks too wide for the column, and what the pages cannot draw. Use it to check page breaks before exporting a PDF.

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

Parameters

Parameters of page.layout
NameTypeRequiredDescription
pageintegernoOnly the blocks placed on this page, from 1.
pageSize"letter" | "a4"noThe page size.

Call through note_run

text
note_run {
  "path": "<file>.md",
  "steps": [{ "command": "page.layout" }]
}

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

Result

Result of page.layout
NameTypeRequiredDescription
blocksobject[]yesWhere each block (or the given page's blocks) lands, at most 500.
overflowobject[]yesBlocks wider than the page's column: a code line wrapped, a table squeezed.
pageSizeobjectyesThe page size in points.
pagesintegeryesHow many pages the note prints on.
unsupportedobjectyesWhat the pages could not draw as the editor shows it.
Result JSON Schema
json
{
  "additionalProperties": false,
  "properties": {
    "blocks": {
      "description": "Where each block (or the given page's blocks) lands, at most 500.",
      "items": {
        "additionalProperties": false,
        "properties": {
          "height": {
            "description": "Points.",
            "type": "number"
          },
          "kind": {
            "description": "What the block is, for example paragraph, heading, list, quote, code, table, math or rule.",
            "type": "string"
          },
          "line": {
            "description": "The block's first line, from 1.",
            "type": "integer"
          },
          "page": {
            "description": "The page, from 1.",
            "type": "integer"
          },
          "width": {
            "description": "Points.",
            "type": "number"
          },
          "x": {
            "description": "Its left edge on the page, in points.",
            "type": "number"
          },
          "y": {
            "description": "Its top edge on the page, in points.",
            "type": "number"
          }
        },
        "required": [
          "height",
          "kind",
          "line",
          "page",
          "width",
          "x",
          "y"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "overflow": {
      "description": "Blocks wider than the page's column: a code line wrapped, a table squeezed.",
      "items": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "description": "code or table.",
            "type": "string"
          },
          "line": {
            "description": "The block's first line, from 1.",
            "type": "integer"
          },
          "page": {
            "description": "The page, from 1.",
            "type": "integer"
          },
          "width": {
            "description": "The width it needs, in points.",
            "type": "number"
          }
        },
        "required": [
          "kind",
          "line",
          "page",
          "width"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "pageSize": {
      "additionalProperties": false,
      "description": "The page size in points.",
      "properties": {
        "height": {
          "description": "Points.",
          "type": "number"
        },
        "width": {
          "description": "Points.",
          "type": "number"
        }
      },
      "required": [
        "height",
        "width"
      ],
      "type": "object"
    },
    "pages": {
      "description": "How many pages the note prints on.",
      "type": "integer"
    },
    "unsupported": {
      "additionalProperties": false,
      "description": "What the pages could not draw as the editor shows it.",
      "properties": {
        "embeds": {
          "description": "Embeds drawn as labelled boxes.",
          "type": "integer"
        },
        "html": {
          "description": "HTML blocks drawn as their source.",
          "type": "integer"
        },
        "images": {
          "description": "Images drawn as labelled boxes.",
          "type": "integer"
        },
        "math": {
          "description": "Math drawn as its source.",
          "type": "integer"
        },
        "mermaid": {
          "description": "Mermaid diagrams drawn as their source.",
          "type": "integer"
        },
        "missingGlyphs": {
          "description": "Characters drawn as boxes: no page font has them.",
          "type": "integer"
        },
        "missingSample": {
          "description": "Up to 24 of those characters, in order of first use.",
          "type": "string"
        }
      },
      "required": [
        "embeds",
        "html",
        "images",
        "math",
        "mermaid",
        "missingGlyphs",
        "missingSample"
      ],
      "type": "object"
    }
  },
  "required": [
    "blocks",
    "overflow",
    "pageSize",
    "pages",
    "unsupported"
  ],
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "page": {
      "description": "Only the blocks placed on this page, from 1.",
      "type": "integer"
    },
    "pageSize": {
      "default": "letter",
      "description": "The page size.",
      "enum": [
        "letter",
        "a4"
      ],
      "type": "string"
    }
  },
  "type": "object"
}

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