render

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBookIgnores = []string{
	".git", "_git",
	"book", "book.ini",
	"node_modules",
}

Functions

This section is empty.

Types

type BookInfo

type BookInfo struct {
	Title           string
	GitRepoIcon     string
	GitRepoUrl      string
	EditUrlTemplate string
	Custom          wabook.CustomConfig
	Giscus          wabook.GiscusConfig
}

type BookRendor

type BookRendor struct {
	Book         *wabook.Book
	BookInfo     *BookInfo
	PageInfos    []*PageInfo
	SidebarItems []*SidebarItem
	Ignores      []string
}

func New

func New() *BookRendor

func (*BookRendor) Run

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

type PageInfo

type PageInfo struct {
	Index int

	Book            *BookInfo
	SidebarItems    []*SidebarItem
	EditUrlTemplate string

	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

type StaticPageInfo

type StaticPageInfo struct {
	Content string
}

Jump to

Keyboard shortcuts

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