# myst-toc

> MyST Table of Contents types and validation

Latest version **0.1.5** (published 2026-10-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install myst-toc
pnpm add myst-toc
yarn add myst-toc
bun add myst-toc
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2026-10-26 |
| First published | 2024-04-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 12.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 526 |
| Author | Angus Hollands |
| Maintainers | rowanc1, ebp-bot |

## Links

- npm: https://www.npmjs.com/package/myst-toc
- Repository: https://github.com/jupyter-book/mystmd
- Homepage: https://github.com/jupyter-book/mystmd/tree/main/packages/myst-toc
- Issues: https://github.com/jupyter-book/mystmd/issues
- npm.io page: https://npm.io/package/myst-toc

## Dependencies (1)

- [simple-validators](https://npm.io/package/simple-validators.md) ^1.2.1

## Recent versions

- 0.1.5 (latest) — 2026-10-26
- 0.1.4 — 2025-12-10
- 0.1.3 — 2025-05-17
- 0.1.2 — 2024-07-24
- 0.1.1 — 2024-06-12
- 0.1.0 — 2024-05-10
- 0.0.0 — 2024-04-30

## README

# myst-toc

Utilities to parse a MyST table of contents.

## Overview

The MyST ToC format is defined in `types.ts`, from which a JSON schema definition is compiled. The high-level description is as follows:

1. A TOC comprises of an array of TOC items
2. Each TOC item can be

- A file (document)
- A URL (document)
- A collection of child items

3. TOC items containing children _must_ have either a `title` or a document

## Example

Example `myst.yml` under the `toc:` key:

```yaml
toc:
  - title: Main
    file: main.md
  - title: Overview
    children:
      - file: overview-1.md
      - file: overview-2.md
  - url: https://google.com
  - file: getting-started.md
    children:
      - file: getting-started-part-1.md
      - file: getting-started-part-2.md
```

---
_Source: https://npm.io/package/myst-toc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
