render

package
v0.0.0-...-aa602b0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookInfo

type BookInfo struct {
	Title           string
	GitRepoIcon     string
	GitRepoUrl      string
	EditUrlTemplate string
}

type BookRendor

type BookRendor struct {
	Book         *mdbook.Book
	BookInfo     *BookInfo
	PageInfos    []*PageInfo
	SidebarItems []*SidebarItem
}

func New

func New() *BookRendor

func (*BookRendor) Run

func (p *BookRendor) Run(book *mdbook.Book) error

type PageInfo

type PageInfo struct {
	Index int

	Book         *BookInfo
	SidebarItems []*SidebarItem

	Root  string
	Path  string
	Title string

	Content string
	RawHtml string

	HasPrev bool
	HasNext bool

	PrevUrl string
	NextUrl string
}

type SidebarItem

type SidebarItem struct {
	Prefix   string
	Number   string // 1.1, 1.2, ...
	Name     string
	Location string
}

type SidebarTree

type SidebarTree []*SidebarItem

func (SidebarTree) Children

func (p SidebarTree) Children(idx int) []int

func (SidebarTree) GenHTML

func (p SidebarTree) GenHTML(pageRoot string, pageIndex int) string

func (SidebarTree) Siblings

func (p SidebarTree) Siblings(idx int) []int

Jump to

Keyboard shortcuts

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