Note kit command

file.export

Export

Writes the note as a standalone HTML file (the reading view with its stylesheet; `standalone: false` only the `<main>` element) or prints it to a PDF on `letter` or `a4` pages, and answers the file as base64 `data` with its size, a file name and, for a PDF, its page count and what the pages could not draw. Does not change the note.

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

Parameters

Parameters of file.export
NameTypeRequiredDescription
format"html" | "pdf"yesThe file's format.
pageSize"letter" | "a4"noPDF: the page size.
standalonebooleannoHTML: a whole file with its stylesheet; false writes the <main> element only.

Call through note_run

text
note_run {
  "path": "<file>.md",
  "steps": [{ "command": "file.export", "params": { "format": <"html" | "pdf"> } }]
}

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

Result

Result of file.export
NameTypeRequiredDescription
bytesintegeryesIts size in bytes.
datastringyesThe file's bytes, base64.
format"html" | "pdf"yesThe format written.
mime"text/html" | "application/pdf"yesIts media type.
namestringyesA file name for it: the note's, ending in .html or .pdf.
pagesintegernoA PDF's page count.
unsupportedobjectnoWhat the pages could not draw as the editor shows it.
Result JSON Schema
json
{
  "additionalProperties": false,
  "properties": {
    "bytes": {
      "description": "Its size in bytes.",
      "type": "integer"
    },
    "data": {
      "description": "The file's bytes, base64.",
      "type": "string"
    },
    "format": {
      "description": "The format written.",
      "enum": [
        "html",
        "pdf"
      ],
      "type": "string"
    },
    "mime": {
      "description": "Its media type.",
      "enum": [
        "text/html",
        "application/pdf"
      ],
      "type": "string"
    },
    "name": {
      "description": "A file name for it: the note's, ending in .html or .pdf.",
      "type": "string"
    },
    "pages": {
      "description": "A PDF's page count.",
      "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": [
    "bytes",
    "data",
    "format",
    "mime",
    "name"
  ],
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "format": {
      "description": "The file's format.",
      "enum": [
        "html",
        "pdf"
      ],
      "type": "string"
    },
    "pageSize": {
      "default": "letter",
      "description": "PDF: the page size.",
      "enum": [
        "letter",
        "a4"
      ],
      "type": "string"
    },
    "standalone": {
      "default": true,
      "description": "HTML: a whole file with its stylesheet; false writes the <main> element only.",
      "type": "boolean"
    }
  },
  "required": [
    "format"
  ],
  "type": "object"
}

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