Layout kit command

anchored.insert

Insert Anchored Object

Anchors objects in a story at a text position, inline or above line, with offsets.

Kit
Layout 0.1.0 (.klayout)
Changes the document
yes
Acts on
ids (a list of ids), which a run step’s on fills

Parameters

Parameters of anchored.insert
NameTypeRequiredDescription
align"left" | "center" | "right"no
edgestringnoread by the command beside its listed parameters
ids(integer | string)[]no
keepWithinColumnbooleanno
objectPointintegerno0 to 8
posintegernoa text position
position"inline" | "aboveLine" | "custom"no
refPointintegerno0 to 8
spaceAfternumberno
spaceBeforenumberno
storyintegernoa story id from file.inspect
tostringnoread by the command beside its listed parameters
xOffsetnumbernopoints
xRelative"anchor" | "textFrame" | "columnEdge" | "pageMargin" | "pageEdge"no
yOffsetnumbernopoints
yRelative"anchor" | "textFrame" | "columnEdge" | "pageMargin" | "pageEdge"no

Call through layout_run

text
layout_run {
  "path": "<file>.klayout",
  "steps": [{ "command": "anchored.insert" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: align, edge, ids, keepWithinColumn, objectPoint, pos, position, refPoint, spaceAfter, spaceBefore, story, to, xOffset, xRelative, yOffset, yRelative. layout_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": {
    "align": {
      "enum": [
        "left",
        "center",
        "right"
      ],
      "type": "string"
    },
    "edge": {
      "description": "read by the command beside its listed parameters",
      "type": "string"
    },
    "ids": {
      "items": {
        "description": "an id",
        "oneOf": [
          {
            "type": "integer"
          },
          {
            "type": "string"
          }
        ]
      },
      "type": "array",
      "x-khp-types": [
        "Item"
      ]
    },
    "keepWithinColumn": {
      "type": "boolean"
    },
    "objectPoint": {
      "description": "0 to 8",
      "type": "integer"
    },
    "pos": {
      "description": "a text position",
      "type": "integer"
    },
    "position": {
      "enum": [
        "inline",
        "aboveLine",
        "custom"
      ],
      "type": "string"
    },
    "refPoint": {
      "description": "0 to 8",
      "type": "integer"
    },
    "spaceAfter": {
      "type": "number"
    },
    "spaceBefore": {
      "type": "number"
    },
    "story": {
      "description": "a story id from file.inspect",
      "type": "integer",
      "x-khp-types": [
        "Story"
      ]
    },
    "to": {
      "description": "read by the command beside its listed parameters",
      "type": "string"
    },
    "xOffset": {
      "description": "points",
      "type": "number"
    },
    "xRelative": {
      "enum": [
        "anchor",
        "textFrame",
        "columnEdge",
        "pageMargin",
        "pageEdge"
      ],
      "type": "string"
    },
    "yOffset": {
      "description": "points",
      "type": "number"
    },
    "yRelative": {
      "enum": [
        "anchor",
        "textFrame",
        "columnEdge",
        "pageMargin",
        "pageEdge"
      ],
      "type": "string"
    }
  },
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (layout_commands through @kition/[email protected], built from KitionAI/kition-layout@8767a18). As data: commands.jsonl.