render

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentBuilder added in v0.0.3

type ContentBuilder[T EncodedText] interface {
	TextEncoder[T]
	String() string // used by list pages
	Markdown(string)
	Para(T)
	Pre(string)
	EmptyPara()
	Preface(m T)
	Heading2(m T, id string)
	Heading3(m T, id string)
	Heading4(m T, id string)
	UnorderedList([]T)
	OrderedList([]T)
	DefinitionList([][2]T)
	BlockQuote(T)
	Timeline([]TimelineRow[T])
	Figure(link string, alt string, caption T, highlight *model.Region, downloadName string)
	FactList([]FactEntry[T])
}

type Document added in v0.0.3

type Document[T EncodedText] interface {
	TextEncoder[T]
	ContentBuilder[T]
	WriteTo(w io.Writer) (int64, error)
	SetFrontMatterField(k, v string)
	Title(s string)
	Summary(s string)
	Layout(s string)
	Category(s string)
	ID(s string)
	AddTag(s string)
	AddTags(ss []string)
	ResetSeenLinks()
	PageBreak()
}

type EncodedText added in v0.0.3

type EncodedText interface {
	String() string
	IsZero() bool
}

type FactEntry added in v0.0.3

type FactEntry[T EncodedText] struct {
	Category string
	Details  []T
}

type NameChooser added in v0.0.3

type NameChooser interface {
	FirstUse(m any) string                                          // prefix, name and suffix to use for first occurrence
	Subsequent(m any) string                                        // prefix, name and suffix to use for subsequent occurrences
	FirstUseSplit(m any, pov *model.POV) (string, string, string)   // prefix, name and suffix to use for first occurrence
	SubsequentSplit(m any, pov *model.POV) (string, string, string) // prefix, name and suffix to use for subsequent occurrences
}

type TextEncoder added in v0.0.3

type TextEncoder[T EncodedText] interface {
	EncodeText(ss ...string) T
	EncodeItalic(T) T
	EncodeBold(T) T
	EncodeLink(s T, url string) T
	EncodeModelLink(s T, m any) T
	EncodeWithCitations(s T, citations []*model.GeneralCitation) T
	EncodeModelLinkDedupe(firstText T, subsequentText T, m any) T
	EncodeModelLinkNamed(m any, nc NameChooser, pov *model.POV) T
}

type TimelineRow

type TimelineRow[T EncodedText] struct {
	Year    string
	Date    string // day and month
	Details []T
}

Directories

Path Synopsis
Package md provides types and functions for encoding markdown
Package md provides types and functions for encoding markdown
Package pandoc provides types and functions for encoding pandoc flavoured markdown
Package pandoc provides types and functions for encoding pandoc flavoured markdown

Jump to

Keyboard shortcuts

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