---
title: "section.read: Read a section — Note kit command — Kition"
description: "Answers the Markdown of one section (the heading and everything under it), picked by heading path or line, with its range and first line; `withHeading: false` leaves the heading line out."
canonical: "https://developer.kition.ai/docs/kits/note/commands/section.read"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/note/commands/section.read](https://developer.kition.ai/docs/kits/note/commands/section.read)

# section.read

**Read a section.** Answers the Markdown of one section (the heading and everything under it), picked by heading path or line, with its range and first line; `withHeading: false` leaves the heading line out.

- Kit: Note 0.3.0 (Markdown (.md)); reference: [Note kit commands](https://developer.kition.ai/docs/kits/note.md)
- Changes the document: no

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `heading` | `string[]` | no | The heading's path from the top, each element a heading's plain text, for example ["Plan", "Risks"]; or give line. |
| `line` | `integer` | no | The heading's line, from 1, instead of heading. |
| `section` | `string` | no | The section's id from outline.read ("section:3"), instead of heading or line: it names the same section after a rename or a move, for as long as the note stays open. |
| `unit` | `"scalar" \| "utf16"` | no | How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them. |
| `withHeading` | `boolean` | no | Include the heading line. |

## Call through note_run

```text
note_run {
  "path": "<file>.md",
  "steps": [{ "command": "section.read" }]
}
```

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

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | `integer` | yes | Where it starts, in the request's unit. |
| `line` | `integer` | yes | Its first line, from 1. |
| `markdown` | `string` | yes | The Markdown, as the file has it. |
| `to` | `integer` | yes | Where it ends (exclusive). |

```json
{
  "additionalProperties": false,
  "properties": {
    "from": {
      "description": "Where it starts, in the request's unit.",
      "type": "integer"
    },
    "line": {
      "description": "Its first line, from 1.",
      "type": "integer"
    },
    "markdown": {
      "description": "The Markdown, as the file has it.",
      "type": "string"
    },
    "to": {
      "description": "Where it ends (exclusive).",
      "type": "integer"
    }
  },
  "required": [
    "from",
    "line",
    "markdown",
    "to"
  ],
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "heading": {
      "description": "The heading's path from the top, each element a heading's plain text, for example [\"Plan\", \"Risks\"]; or give line.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "line": {
      "description": "The heading's line, from 1, instead of heading.",
      "type": "integer"
    },
    "section": {
      "description": "The section's id from outline.read (\"section:3\"), instead of heading or line: it names the same section after a rename or a move, for as long as the note stays open.",
      "type": "string"
    },
    "unit": {
      "default": "scalar",
      "description": "How positions are counted: Unicode characters (scalar, the default), or UTF-16 code units as the editor counts them.",
      "enum": [
        "scalar",
        "utf16"
      ],
      "type": "string"
    },
    "withHeading": {
      "default": true,
      "description": "Include the heading line.",
      "type": "boolean"
    }
  },
  "type": "object"
}
```

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