Note kit command

file.setLineEndings

Set the line endings

Sets the file's line endings to LF or CRLF and whether it starts with a byte order mark; the text is otherwise unchanged. Answers the line style the file has now.

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

Parameters

Parameters of file.setLineEndings
NameTypeRequiredDescription
bombooleannoWrite a UTF-8 byte order mark; unchanged by default.
eol"lf" | "crlf"yesLF or CRLF for every line.

Call through note_run

text
note_run {
  "path": "<file>.md",
  "steps": [{ "command": "file.setLineEndings", "params": { "eol": <"lf" | "crlf"> } }]
}

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

Result

Result of file.setLineEndings
NameTypeRequiredDescription
bombooleanyesWhether the file starts with a byte order mark.
changedbooleanyesWhether the file changed.
eol"lf" | "crlf"yesThe line endings the file has now.
Result JSON Schema
json
{
  "additionalProperties": false,
  "properties": {
    "bom": {
      "description": "Whether the file starts with a byte order mark.",
      "type": "boolean"
    },
    "changed": {
      "description": "Whether the file changed.",
      "type": "boolean"
    },
    "eol": {
      "description": "The line endings the file has now.",
      "enum": [
        "lf",
        "crlf"
      ],
      "type": "string"
    }
  },
  "required": [
    "bom",
    "changed",
    "eol"
  ],
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "bom": {
      "description": "Write a UTF-8 byte order mark; unchanged by default.",
      "type": "boolean"
    },
    "eol": {
      "description": "LF or CRLF for every line.",
      "enum": [
        "lf",
        "crlf"
      ],
      "type": "string"
    }
  },
  "required": [
    "eol"
  ],
  "type": "object"
}

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