Skip to main content

internal/docsite/sidebars.go

internal/docsite · 101 lines · 7 declarations · source

Declarations

type sidebarItem

type sidebarItem struct {
Type string `json:"type"`
ID string `json:"id,omitempty"`
Label string `json:"label,omitempty"`
Link *sidebarLink `json:"link,omitempty"`
Collapsed *bool `json:"collapsed,omitempty"`
Items []*sidebarItem `json:"items,omitempty"`
}

source

type sidebarLink struct {
Type string `json:"type"`
ID string `json:"id"`
}

source

var partLine, entryLine, prefixLine

var (
partLine = regexp.MustCompile(`^#\s+(.+?)\s*$`)
entryLine = regexp.MustCompile(`^( *)- \[([^\]]+)\]\(([^)\s]+)\)\s*$`)
prefixLine = regexp.MustCompile(`^\[([^\]]+)\]\(([^)\s]+)\)\s*$`)
)

source

const referencePart

const referencePart = "Reference"

source

func sidebars(summary string) ([]byte, error)

source

func docID

func docID(target string) string

source

func boolPtr

func boolPtr(b bool) *bool

source