sgml

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTitle = "Untitled"

DefaultTitle the default title to render when the document has none

Variables

This section is empty.

Functions

func EscapeString

func EscapeString(s string) string

EscapeString is like html5.Escape func except but bypasses a few replacements. It is a bit more conservative.

Types

type Attribution

type Attribution struct {
	First  string
	Second string
}

Attribution a document block attribution

type Context

type Context = renderer.Context

Context the rendering context

type RenderLinesConfig

type RenderLinesConfig struct {
	// contains filtered or unexported fields
}

RenderLinesConfig the config to use when rendering paragraph lines

type RenderLinesOption

type RenderLinesOption func(c *RenderLinesConfig)

RenderLinesOption an option to configure the rendering

type Renderer

type Renderer interface {

	// Render renders a document to the given output stream.
	Render(ctx *renderer.Context, doc types.Document, output io.Writer) (types.Metadata, error)

	// SetFunction sets the named function.
	SetFunction(name string, fn interface{})

	// Templates returns the Templates used by this Renderer.
	// It cannot be altered on a given Renderer, since the old
	// templates may have already been parsed.
	Templates() Templates
}

Renderer implements the backend render interface by using sgml.

func NewRenderer

func NewRenderer(t Templates) Renderer

NewRenderer returns a new renderer

type Templates

type Templates struct {
	AdmonitionBlock           string
	AdmonitionParagraph       string
	Article                   string
	ArticleHeader             string
	BlankLine                 string
	BlockImage                string
	BoldText                  string
	CalloutList               string
	CalloutListItem           string
	CalloutRef                string
	DelimitedBlockParagraph   string
	DocumentDetails           string
	DocumentAuthorDetails     string
	ExampleBlock              string
	ExternalCrossReference    string
	FencedBlock               string
	Footnote                  string
	FootnoteItem              string
	FootnoteRef               string
	FootnoteRefPlain          string
	Footnotes                 string
	IconFont                  string
	IconImage                 string
	IconText                  string
	InlineIcon                string
	InlineImage               string
	InternalCrossReference    string
	InvalidFootnote           string
	ItalicText                string
	LabeledList               string
	LabeledListItem           string
	LabeledListHorizontal     string
	LabeledListHorizontalItem string
	LineBreak                 string
	Link                      string
	ListingBlock              string
	LiteralBlock              string
	ManpageHeader             string
	ManpageNameParagraph      string
	MarkdownQuoteBlock        string
	MarkedText                string
	MonospaceText             string
	OrderedList               string
	OrderedListItem           string
	Paragraph                 string
	PassthroughBlock          string
	Preamble                  string
	PredefinedAttribute       string
	QAndAList                 string
	QAndAListItem             string
	QuoteBlock                string
	QuoteParagraph            string
	SectionContent            string
	SectionHeader             string
	SidebarBlock              string
	SourceBlock               string
	SpecialCharacter          string
	StringElement             string
	SubscriptText             string
	SuperscriptText           string
	Table                     string
	TableBody                 string
	TableCell                 string
	TableHeader               string
	TableHeaderCell           string
	TableRow                  string
	ThematicBreak             string
	TocEntry                  string
	TocRoot                   string
	TocSection                string
	UnorderedList             string
	UnorderedListItem         string
	VerbatimLine              string
	VerseBlock                string
	VerseParagraph            string
}

Templates represents all the templates we use.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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