mdbook

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBook = Book{
	Title:         "默认标题",
	BasePath:      "",
	PrefixChapter: &LineNodes{},
}

Functions

func BooKTest

func BooKTest()

func SetBook

func SetBook(b Book)

Types

type Book

type Book struct {
	Title           string
	BasePath        string
	PrefixChapter   *LineNodes
	PartChapters    []*PartChapter
	NumberedChapter *LineNodes
	SuffixChapter   *LineNodes
	DraftChapters   *LineNodes
}

func (*Book) AddNode

func (a *Book) AddNode(basePath, fullPath, title string)

func (*Book) AddPart

func (a *Book) AddPart(title string)

func (*Book) Markdown

func (a *Book) Markdown() *bytes.Buffer

type Line

type Line struct {
	Title    string
	BasePath string
	Path     string
	IsNumber bool

	IsSeparators bool
	// contains filtered or unexported fields
}

func (*Line) GetPath

func (a *Line) GetPath() string

func (*Line) LevelSpace

func (a *Line) LevelSpace() string

func (*Line) LineString

func (a *Line) LineString() string

func (*Line) Markdown

func (a *Line) Markdown(buf *bytes.Buffer)

type LineList

type LineList []*Line

type LineNode

type LineNode struct {
	Line
	LineNodes *LineNodes
}

func (*LineNode) Markdown

func (a *LineNode) Markdown(buf *bytes.Buffer)

type LineNodes

type LineNodes struct {
	List []*LineNode
}

func (*LineNodes) GetNode

func (a *LineNodes) GetNode(basePath string) *LineNode

func (*LineNodes) GetNodes

func (a *LineNodes) GetNodes(basePath string) (list *LineNodes)

func (*LineNodes) Markdown

func (a *LineNodes) Markdown(buf *bytes.Buffer, level int, basePath string)

func (*LineNodes) Sort

func (a *LineNodes) Sort()

type PartChapter

type PartChapter struct {
	Title string
	Parts *LineNodes
}

func (*PartChapter) Markdown

func (a *PartChapter) Markdown(buf *bytes.Buffer, level int, basePath string)

type PartChapters

type PartChapters []*PartChapter

Jump to

Keyboard shortcuts

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