blocks

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertBlock

type AlertBlock struct {
	Content string
}

func (AlertBlock) RenderHTML

func (b AlertBlock) RenderHTML() string

func (AlertBlock) RenderText

func (b AlertBlock) RenderText() string

type Block

type Block interface {
	RenderText() string
	RenderHTML() string
}

A block is anything that can be rendered to both HTML and Plaintext

type ButtonBlock

type ButtonBlock struct {
	Content string
	Href    string
}

func (ButtonBlock) RenderHTML

func (b ButtonBlock) RenderHTML() string

func (ButtonBlock) RenderText

func (b ButtonBlock) RenderText() string

type CodeBlock

type CodeBlock struct {
	Label string
	Code  string
}

func (CodeBlock) RenderHTML

func (b CodeBlock) RenderHTML() string

func (CodeBlock) RenderText

func (b CodeBlock) RenderText() string

type DivBlock

type DivBlock struct {
	Children []Block
	Style    string
}

A div represents its children

func (DivBlock) RenderHTML

func (b DivBlock) RenderHTML() string

func (DivBlock) RenderText

func (b DivBlock) RenderText() string

type DividerBlock

type DividerBlock struct {
	Content string
	Href    string
}

func (DividerBlock) RenderHTML

func (b DividerBlock) RenderHTML() string

func (DividerBlock) RenderText

func (b DividerBlock) RenderText() string

type HeaderBlock

type HeaderBlock struct {
	Content string
}

HeaderBlock represents a large page header with text

func (HeaderBlock) RenderHTML

func (b HeaderBlock) RenderHTML() string

func (HeaderBlock) RenderText

func (b HeaderBlock) RenderText() string

type MarkdownBlock

type MarkdownBlock struct {
	Content string
}

MarkdownBlock has its content passed through blackfriday for HTML and returns the markdown representation for plaintext

func (MarkdownBlock) RenderHTML

func (b MarkdownBlock) RenderHTML() string

func (MarkdownBlock) RenderText

func (b MarkdownBlock) RenderText() string

type ParagraphBlock

type ParagraphBlock struct {
	Content string
}

ParagraphBlock represents a basic block of text

func (ParagraphBlock) RenderHTML

func (b ParagraphBlock) RenderHTML() string

func (ParagraphBlock) RenderText

func (b ParagraphBlock) RenderText() string

Jump to

Keyboard shortcuts

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