Doc kit command
list.define
Define New Multilevel List
Defines a new multilevel list (number format, text, start, indents per level) and applies it to the selected paragraphs; a number format it can't draw is refused.
- Kit
- Doc 0.1.0 (.docx)
- Changes the document
- yes
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
apply | boolean | no | default true: number the selected paragraphs |
levels | any[] | no | [{"format"?: "decimal|upperRoman|lowerRoman|upperLetter|lowerLetter|ordinal|cardinalText|ordinalText|decimalZero|bullet|none|chineseCounting|chineseCountingThousand|chineseLegalSimplified|decimalEnclosedCircle|decimalEnclosedCircleChinese|ideographDigital" (other formats are refused), "text"?: "%1.%2." (%n = level n's number; the bullet character for bullet), "start"?: n, "restartAfter"?: 0-8 (0 = never; omit = the level above), "style"?: paragraph style linked to the level | null, "align"?: "left|center|right", "alignedAt"?: pt, "indentAt"?: pt, "follow"?: "tab|space|nothing", "tabAt"?: pt | null, "font"?: string | null, "bold"?: bool, "italic"?: bool, "color"?: "RRGGBB" | null, "legal"?: bool}, …] (index = level, up to 9; fields left out keep the base list's); other formats are refused; %n = level n's number; the bullet character for bullet; 0 = never; omit = the level above; index = level, up to 9; fields left out keep the base list's |
name | string | no | |
num | integer | no | list id to change in place (default: a new list) |
Call through doc_run
text
doc_run {
"path": "<file>.docx",
"steps": [{ "command": "list.define" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: apply, levels, name, num. doc_run answers the step’s result in completed[i].result.
Result
The kit gives no result schema for this command.
Parameter schema
json
{
"additionalProperties": false,
"properties": {
"apply": {
"description": "default true: number the selected paragraphs",
"type": "boolean"
},
"levels": {
"description": "[{\"format\"?: \"decimal|upperRoman|lowerRoman|upperLetter|lowerLetter|ordinal|cardinalText|ordinalText|decimalZero|bullet|none|chineseCounting|chineseCountingThousand|chineseLegalSimplified|decimalEnclosedCircle|decimalEnclosedCircleChinese|ideographDigital\" (other formats are refused), \"text\"?: \"%1.%2.\" (%n = level n's number; the bullet character for bullet), \"start\"?: n, \"restartAfter\"?: 0-8 (0 = never; omit = the level above), \"style\"?: paragraph style linked to the level | null, \"align\"?: \"left|center|right\", \"alignedAt\"?: pt, \"indentAt\"?: pt, \"follow\"?: \"tab|space|nothing\", \"tabAt\"?: pt | null, \"font\"?: string | null, \"bold\"?: bool, \"italic\"?: bool, \"color\"?: \"RRGGBB\" | null, \"legal\"?: bool}, …] (index = level, up to 9; fields left out keep the base list's); other formats are refused; %n = level n's number; the bullet character for bullet; 0 = never; omit = the level above; index = level, up to 9; fields left out keep the base list's",
"type": "array"
},
"name": {
"type": "string"
},
"num": {
"description": "list id to change in place (default: a new list)",
"type": "integer"
}
},
"type": "object"
}Generated from the command list of @kition/[email protected] and the kit itself (doc_commands through @kition/[email protected], built from KitionAI/kition-doc@41e14a8). As data: commands.jsonl.