TocEntry
import { TocEntry } from "jsr:@ende/markdown";interface
interface TocEntryA heading in the list toc() returns.
Example: Usage
import type { TocEntry } from "@ende/markdown/types";
import { assertEquals } from "@ende/assert";
const entry: TocEntry = { depth: 2, text: "Install", slug: "install" };
assertEquals(`<a href="#${entry.slug}">${entry.text}</a>`, "<a href=\"#install\">Install</a>");
Properties
depth
depth: Heading["depth"]The heading level, from 1 to 6.
text
text: stringThe heading's plain text, as the slugger got it. Escape it for HTML.
slug
slug: stringThe heading's Heading.id.