core

package
v38.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: MIT Imports: 11 Imported by: 8

Documentation

Index

Constants

View Source
const (
	QuarterRow = 3
	HalfRow    = 6
	EntireRow  = 12
)
View Source
const (
	CardNoBadgeCount = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Anchor

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

func NewAnchor

func NewAnchor(name string) *Anchor

func (*Anchor) WriteHTMLTo

func (c *Anchor) WriteHTMLTo(w io.Writer) (int64, error)

type BadgePill

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

BadgePill is a rounded badge that contains a value.

func NewBadgePill

func NewBadgePill(color, class string, value Component) *BadgePill

func (*BadgePill) WriteHTMLTo

func (c *BadgePill) WriteHTMLTo(w io.Writer) (int64, error)

type BigTitle

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

func NewBigTitle

func NewBigTitle(size int, text Component) *BigTitle

func (*BigTitle) WriteHTMLTo

func (c *BigTitle) WriteHTMLTo(w io.Writer) (int64, error)

type Card

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

Card is a simple box with a header and body section.

func NewCard

func NewCard(title Component, count int, body Component) *Card

func (*Card) WriteHTMLTo

func (c *Card) WriteHTMLTo(w io.Writer) (int64, error)

type Column

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

Column is used inside of a row. The row consists of 12 virtual columns and each column can specify how many of the columns it represents.

func NewColumn

func NewColumn(width int, body Component) *Column

func (*Column) WriteHTMLTo

func (c *Column) WriteHTMLTo(w io.Writer) (int64, error)

type Component

type Component interface {
	WriteHTMLTo(w io.Writer) (n int64, err error)
}

type Components

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

Components is a wrapper for zero more components that rendered at the same time.

func NewComponents

func NewComponents(items ...Component) *Components

func (*Components) WriteHTMLTo

func (c *Components) WriteHTMLTo(w io.Writer) (int64, error)

type CountBadge

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

CountBadge shows a pill badge containing an integer. The appropriate localization will be applied (like a thousands separator).

func NewCountBadge

func NewCountBadge(value int) *CountBadge

func (*CountBadge) WriteHTMLTo

func (c *CountBadge) WriteHTMLTo(w io.Writer) (int64, error)

type DirectoryFileWriter

type DirectoryFileWriter struct {
	WillWriteFile func(file *File)
	// contains filtered or unexported fields
}

func NewDirectoryFileWriter

func NewDirectoryFileWriter(outputDir string) *DirectoryFileWriter

func (*DirectoryFileWriter) WriteFile

func (writer *DirectoryFileWriter) WriteFile(file *File) error

type Div

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

Div is a <div> tag with a class.

func NewDiv

func NewDiv(class string, body Component) *Div

func (*Div) WriteHTMLTo

func (c *Div) WriteHTMLTo(w io.Writer) (int64, error)

type Empty

type Empty struct{}

Empty is used a placeholder for a component where nothing should be visible.

func NewEmpty

func NewEmpty() *Empty

func (*Empty) WriteHTMLTo

func (c *Empty) WriteHTMLTo(w io.Writer) (int64, error)

type File

type File struct {
	Name      string
	Component Component
}

func NewFile

func NewFile(name string, component Component) *File

type FileWriter

type FileWriter interface {
	WriteFile(file *File) error
}

type FooterRow

type FooterRow struct{}

FooterRow appears on all pages at the bottom.

func NewFooterRow

func NewFooterRow() *FooterRow

func (*FooterRow) WriteHTMLTo

func (c *FooterRow) WriteHTMLTo(w io.Writer) (int64, error)

type GoogleAnalytics

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

func NewGoogleAnalytics

func NewGoogleAnalytics(id string) *GoogleAnalytics

func (*GoogleAnalytics) WriteHTMLTo

func (c *GoogleAnalytics) WriteHTMLTo(w io.Writer) (int64, error)

type HTML

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

func NewHTML

func NewHTML(s string) *HTML

func (*HTML) WriteHTMLTo

func (c *HTML) WriteHTMLTo(w io.Writer) (int64, error)

type Heading

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

Heading is larger text.

func NewHeading

func NewHeading(number int, class string, body Component) *Heading

func (*Heading) WriteHTMLTo

func (c *Heading) WriteHTMLTo(w io.Writer) (int64, error)

type HorizontalRule

type HorizontalRule struct{}

HorizontalRule is a dividing line.

func NewHorizontalRule

func NewHorizontalRule() *HorizontalRule

func (*HorizontalRule) WriteHTMLTo

func (c *HorizontalRule) WriteHTMLTo(w io.Writer) (int64, error)

type HorizontalRuleRow

type HorizontalRuleRow struct{}

HorizontalRuleRow is a dividing line.

func NewHorizontalRuleRow

func NewHorizontalRuleRow() *HorizontalRuleRow

func (*HorizontalRuleRow) WriteHTMLTo

func (c *HorizontalRuleRow) WriteHTMLTo(w io.Writer) (int64, error)

type KeyedTableRow

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

KeyedTableRow is a table row consisting of two columns where the left column is a header and a key for the data in the right column. It also allows the row to be hidden altogether if needed.

func NewKeyedTableRow

func NewKeyedTableRow(title string, value Component, visible bool) *KeyedTableRow

func (*KeyedTableRow) WriteHTMLTo

func (c *KeyedTableRow) WriteHTMLTo(w io.Writer) (int64, error)

type LineBreak

type LineBreak struct{}

func NewLineBreak

func NewLineBreak() *LineBreak

func (*LineBreak) WriteHTMLTo

func (c *LineBreak) WriteHTMLTo(w io.Writer) (int64, error)

type Lines

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

func NewLines

func NewLines(lines ...Component) *Lines

func (*Lines) WriteHTMLTo

func (c *Lines) WriteHTMLTo(w io.Writer) (int64, error)
type Link struct {
	// contains filtered or unexported fields
}
func NewLink(body Component, dest string) *Link

func (*Link) Style

func (c *Link) Style(style string) *Link

func (*Link) WriteHTMLTo

func (c *Link) WriteHTMLTo(w io.Writer) (int64, error)
type NavItem struct {
	// contains filtered or unexported fields
}

NavItem is a single tab in the tab bar.

func NewNavItem

func NewNavItem(content Component, isActive bool, href string) *NavItem
func (c *NavItem) WriteHTMLTo(w io.Writer) (int64, error)
type NavLink struct {
	// contains filtered or unexported fields
}
func NewNavLink(text, link string, isSelected bool) *NavLink
func (c *NavLink) WriteHTMLTo(w io.Writer) (int64, error)
type NavPills struct {
	// contains filtered or unexported fields
}

func NewNavPills

func NewNavPills(links []Component) *NavPills
func (c *NavPills) WriteHTMLTo(w io.Writer) (int64, error)
type NavPillsRow struct {
	// contains filtered or unexported fields
}

func NewNavPillsRow

func NewNavPillsRow(links []Component) *NavPillsRow
func (c *NavPillsRow) WriteHTMLTo(w io.Writer) (int64, error)
type NavTabs struct {
	// contains filtered or unexported fields
}

NavTabs is a group of tabs.

func NewNavTabs

func NewNavTabs(items []*NavItem) *NavTabs
func (c *NavTabs) WriteHTMLTo(w io.Writer) (int64, error)

type Number

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

func NewNumber

func NewNumber(value int) *Number

func (*Number) WriteHTMLTo

func (c *Number) WriteHTMLTo(w io.Writer) (int64, error)

type Octicon

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

func NewOcticon

func NewOcticon(name, style string) *Octicon

func (*Octicon) WriteHTMLTo

func (c *Octicon) WriteHTMLTo(w io.Writer) (int64, error)

type Page

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

Page is the entire page wrapped that provides the HTML head and body.

func NewPage

func NewPage(title string, body Component, googleAnalyticsID string) *Page

func (*Page) WriteHTMLTo

func (c *Page) WriteHTMLTo(w io.Writer) (int64, error)

type Row

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

Row is a page row for Bootstrap.

func NewRow

func NewRow(columns ...*Column) *Row

func (*Row) WriteHTMLTo

func (c *Row) WriteHTMLTo(w io.Writer) (int64, error)

type Space

type Space struct{}

Space is an empty row used as a white space separator between other page rows.

func NewSpace

func NewSpace() *Space

func (*Space) WriteHTMLTo

func (c *Space) WriteHTMLTo(w io.Writer) (int64, error)

type Span

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

func NewSpan

func NewSpan(class string, value Component) *Span

func (*Span) WriteHTMLTo

func (c *Span) WriteHTMLTo(w io.Writer) (int64, error)

type Table

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

Table is a HTML table.

func NewTable

func NewTable(tableClass string, content ...Component) *Table

func (*Table) WriteHTMLTo

func (c *Table) WriteHTMLTo(w io.Writer) (int64, error)

type TableCell

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

func NewTableCell

func NewTableCell(content Component) *TableCell

func (*TableCell) Class

func (c *TableCell) Class(class string) *TableCell

func (*TableCell) Header

func (c *TableCell) Header() *TableCell

func (*TableCell) NoWrap

func (c *TableCell) NoWrap() *TableCell

func (*TableCell) Style

func (c *TableCell) Style(style string) *TableCell

func (*TableCell) WriteHTMLTo

func (c *TableCell) WriteHTMLTo(w io.Writer) (int64, error)

type TableHead

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

TableHead is the <thead> section of a table that contains the table heading cells.

func NewTableHead

func NewTableHead(columns ...string) *TableHead

func (*TableHead) WriteHTMLTo

func (c *TableHead) WriteHTMLTo(w io.Writer) (int64, error)

type TableRow

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

func NewTableRow

func NewTableRow(cells ...Component) *TableRow

func (*TableRow) WriteHTMLTo

func (c *TableRow) WriteHTMLTo(w io.Writer) (int64, error)

type Tag

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

func NewTag

func NewTag(tag string, attributes map[string]string, body Component) *Tag

func (*Tag) WriteHTMLTo

func (c *Tag) WriteHTMLTo(w io.Writer) (int64, error)

type Text

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

Text allows text to be rendered on the page.

func NewText

func NewText(s string) *Text

func (*Text) WriteHTMLTo

func (c *Text) WriteHTMLTo(w io.Writer) (int64, error)

Jump to

Keyboard shortcuts

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