appstate

package
v2.0.0-rc13 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const BadId = -1

Variables

View Source
var (
	//go:embed appstate.js
	Js string
)

Functions

This section is empty.

Types

type AppState

type AppState struct {
	InitialRender
	RenderedFiles []HtmlAndLabels
}

func New

func New(
	dSource string, files []*parsren.RenderedMdFile, title string) *AppState

func (*AppState) InitialLabels

func (as *AppState) InitialLabels() loader.LabelList

func (*AppState) SetInitialFileIndex

func (as *AppState) SetInitialFileIndex(p string)

type Facts

type Facts struct {
	InitialFileIndex      int
	InitialCodeBlockIndex int
	NumFolders            int
	MaxCodeBlocksInAFile  int
	MaxNavWordLength      int
	IsNavVisible          bool
	IsTitleVisible        bool
}

type HtmlAndLabels

type HtmlAndLabels struct {
	Html            template.HTML
	CodeBlockLabels loader.LabelList
}

HtmlAndLabels has the rendered HTML from a markdown file, plus a list of code labels, one label (the main label) for each code block in the file.

type InitialRender

type InitialRender struct {
	Title        string
	DataSource   string
	OrderedPaths []loader.FilePath
	Facts        Facts
}

Jump to

Keyboard shortcuts

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