markdown

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2025 License: UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const MaxDepth = 6

Variables

This section is empty.

Functions

This section is empty.

Types

type Toc

type Toc struct {
	Items []*TocItem
}

func TocInspect

func TocInspect(n ast.Node, src []byte, opts TocOptions) (Toc, error)

type TocItem

type TocItem struct {
	// Title of this item in the table of contents.
	//
	// This may be blank for items that don't refer to a heading, and only
	// have sub-items.
	Title []byte

	// ID is the identifier for the heading that this item refers to. This
	// is the fragment portion of the link without the "#".
	//
	// This may be blank if the item doesn't have an id assigned to it, or
	// if it doesn't have a title.
	//
	// Enable AutoHeadingID in your parser if you expected these to be set
	// but they weren't.
	ID []byte

	// Items references children of this item.
	//
	// For a heading at level 3, Items, contains the headings at level 4
	// under that section.
	Items []*TocItem
}

func (TocItem) Anchor

func (i TocItem) Anchor() string

type TocOptions

type TocOptions struct {
	MinDepth, MaxDepth int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL