render

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InlineMarkdownEncoder

type InlineMarkdownEncoder interface {
	EncodeItalic(m string) string
	EncodeBold(m string) string
	EncodeLink(text string, url string) string
	EncodeModelLink(text string, m any) string
}

type Markdown

type Markdown string

func (Markdown) ToHTML

func (m Markdown) ToHTML(w io.Writer) error

type MarkupBuilder

type MarkupBuilder interface {
	InlineMarkdownEncoder
	PageMarkdownEncoder
	String() string // used by list pages
	RawMarkdown(Markdown)
	Para(Markdown)
	Pre(string)
	EmptyPara()
	Heading2(m Markdown, id string)
	Heading3(m Markdown, id string)
	Heading4(m Markdown, id string)
	UnorderedList([]Markdown)
	OrderedList([]Markdown)
	DefinitionList([][2]Markdown)
	BlockQuote(Markdown)
	Timeline([]TimelineRow)
}

type Page

type Page interface {
	PageMarkdownEncoder
	MarkupBuilder
	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()
}

type PageMarkdownEncoder

type PageMarkdownEncoder interface {
	InlineMarkdownEncoder
	EncodeCitationDetail(c *model.GeneralCitation) string
	EncodeWithCitations(s string, citations []*model.GeneralCitation) string
	EncodeModelLinkDedupe(firstText string, subsequentText string, m any) string
}

A PageMarkdownEncoder provides methods that encode as markdown but require or add additional context at the page level.

type TimelineRow

type TimelineRow struct {
	Year    string
	Date    string
	Details []Markdown
}

Jump to

Keyboard shortcuts

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