mdbook

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	Root    string
	Info    *BookToml
	Summary *Summary
}

func LoadBook

func LoadBook(path string) (book *Book, err error)

type BookConfig

type BookConfig struct {
	Authors     []string `json:"authors" toml:"authors"`
	Description string   `json:"description" toml:"description"`
	Language    string   `json:"language" toml:"language"`
	Src         string   `json:"src" toml:"src"`
	Title       string   `json:"title" toml:"title"`
}

type BookToml

type BookToml struct {
	Book       BookConfig `json:"book" toml:"book"`
	OutputHtml HtmlConfig `json:"output.html" toml:"output.html"`
}

func LoadConfig

func LoadConfig(path string) (meta *BookToml, err error)

func (*BookToml) String

func (p *BookToml) String() string

type HtmlConfig

type HtmlConfig struct {
	GitRepositoryIcon string `json:"git-repository-icon" toml:"git-repository-icon"`
	GitRepositoryUrl  string `json:"git-repository-url" toml:"git-repository-url"`
	EditUrlTemplate   string `json:"edit-url-template" toml:"edit-url-template"`
}

type Summary

type Summary struct {
	Title    string // Summary
	Chapters []SummaryItem
}

func LoadSummary

func LoadSummary(path string) (*Summary, error)

func LoadSummaryFrom

func LoadSummaryFrom(path string, data []byte) (*Summary, error)

func (*Summary) String

func (p *Summary) String() string

type SummaryItem

type SummaryItem struct {
	Prefix   string // "", "-", "*", "  -", "  *"
	Name     string
	Location string
}

Jump to

Keyboard shortcuts

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