book

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: EUPL-1.2 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveCrossReferences

func ResolveCrossReferences(pages []*Page) error

ResolveCrossReferences replaces cross-references to other pages with their corresponding paths.

Types

type Book

type Book struct {
	MetaData *MetaData
	Pages    []*Page
}

func New

func New(file []byte) (*Book, error)

type Chapter

type Chapter struct {
	Id      int
	Level   int
	Path    string
	Title   *Title
	Content *Content
}

func Chapters

func Chapters(body *html.Node) ([]*Chapter, error)

type Content

type Content struct {
	Html template.HTML
}

type MetaData

type MetaData struct {
	Title   string
	Author  string
	Date    string
	Preface template.HTML
}

type Page

type Page struct {
	Id          int
	Level       int
	Path        string
	Title       *Title
	Content     *Content
	Next        *Chapter
	HasNext     bool
	Previous    *Chapter
	HasPrevious bool
	Parents     []*Chapter
	HasParents  bool
	Children    []*Chapter
	HasChildren bool
}

func Pages

func Pages(body *html.Node) ([]*Page, error)

type Title

type Title struct {
	Prefix string
	Html   template.HTML
	Text   string
}

Jump to

Keyboard shortcuts

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