package tableofcontents
import "github.com/gohugoio/hugo/markup/tableofcontents"
Index ¶
Variables ¶
DefaultConfig is the default ToC configuration.
Types ¶
type Config ¶
type Config struct { // Heading start level to include in the table of contents, starting // at h1 (inclusive). StartLevel int // Heading end level, inclusive, to include in the table of contents. // Default is 3, a value of -1 will include everything. EndLevel int // Whether to produce a ordered list or not. Ordered bool }
type Heading ¶
Heading holds the data about a heading and its children.
func (Heading) IsZero ¶
IsZero is true when no ID or Text is set.
type Headings ¶
type Headings []Heading
Headings holds the top level headings.
type Root ¶
type Root struct { Headings Headings }
Root implements AddAt, which can be used to build the data structure for the ToC.
func (*Root) AddAt ¶
AddAt adds the heading into the given location.
func (Root) ToHTML ¶
ToHTML renders the ToC as HTML.
Source Files ¶
- Version
- v0.100.1
- Published
- Jun 1, 2022
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 1 minute ago –
Tools for package owners.