pages

package
v0.0.0-...-f390a08 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ContentDirName = "contents"
View Source
const ImageFolderName = "images"
View Source
const StaticFolderName = "_static"
View Source
const SummaryFileName = "SUMMARY.md"

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	SourcePath string
	What       AssetType
	Version    string
	Storage    os.DirEntry
}

Asset A binary asset used with the markdown files, such as images.

type AssetType

type AssetType int

AssetType Where we have an asset that is not a markdown file what is its type

const (
	Undefined AssetType = iota
	Image
)

An enumerated set of asset types

type Doc

type Doc struct {
	SourcePath string
	Version    string
	Storage    os.DirEntry
}

Doc A markdown document.

type OrderedTocSection

type OrderedTocSection struct {
	Name    string
	Order   int
	Section *TOCSection
}

OrderedTocSection Versions An ordered array of the sections of the book

type OrderedVersionTocs

type OrderedVersionTocs struct {
	Version  string
	Order    int
	Sections []OrderedTocSection
}

OrderedVersionTocs The table of contents for a version, ordered by "Version" and "Order"

type Root

type Root struct {
	DestPath   string
	SourcePath string
	GitBook    *Doc
	ReadMe     *Doc
	WorkDir    string
}

Root The root of the book.

type Shared

type Shared struct {
	Docs   map[string]Doc
	Images map[string]Asset
	TOC    *Doc
}

Shared Assets & Docs shared by all versions of the book

type TOCEntry

type TOCEntry struct {
	Name  string `yaml:"name"`
	File  string `yaml:"file"`
	Order int    `yaml:"order"`
}

TOCEntry A table of contents entry.

type TOCSection

type TOCSection struct {
	Order   int        `yaml:"order"`
	Entries []TOCEntry `yaml:"entries"`
}

TOCSection A table of contents sections - the name of the section is held in the Toc map below.

type Toc

type Toc struct {
	Sections map[string]*TOCSection `yaml:"Sections"`
}

Toc A table of contents with a map of names to section within a table of contents.

type Version

type Version struct {
	DestPath string
	Docs     map[string]Doc
	Images   map[string]Asset
	TOC      *Doc
	Version  string
}

Version Docs & Assets for a version of the book

type VersionedToc

type VersionedToc struct {
	Contents map[string]*Toc
}

VersionedToc A map of versions to a table of contents.

func (*VersionedToc) Sort

func (t *VersionedToc) Sort() (ordered []OrderedVersionTocs)

Jump to

Keyboard shortcuts

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