bootstrapper

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: MIT Imports: 7 Imported by: 1

README

Bootstrapper

Build Status Go Report Card Docs License

This is a library to generate various Bootstrap examples boilerplate for Quicktemplate:

Documentation

Index

Constants

View Source
const (
	ColSizeXs   = "xs" // for phones - screens less than 768px wide
	ColSizeSm   = "sm" // for tablets - screens equal to or greater than 768px wide
	ColSizeMd   = "md" // for small laptops - screens equal to or greater than 992px wide
	ColSizeLg   = "lg" // for laptops and desktops - screens equal to or greater than 1200px wide
	ColMaxWidth = 12
)

Variables

View Source
var (
	ErrWidthTooLarge   = errors.New("max width of 12 exceeded")
	ErrWidthIsNegative = errors.New("width cannot be negative")
)

Functions

func ColWidthToClass added in v0.4.0

func ColWidthToClass(size string, width int) (string, error)
func NavbarHtml(navData Navbar) string

func StreamNavbarHtml

func StreamNavbarHtml(qw422016 *qt422016.Writer, navData Navbar)

func StreamWebpageHTML added in v0.4.0

func StreamWebpageHTML(qw422016 *qt422016.Writer, pageData Webpage)

func WebpageHTML added in v0.4.0

func WebpageHTML(pageData Webpage) string

func WriteNavbarHtml

func WriteNavbarHtml(qq422016 qtio422016.Writer, navData Navbar)

func WriteWebpageHTML added in v0.4.0

func WriteWebpageHTML(qq422016 qtio422016.Writer, pageData Webpage)

Types

type AlbumCell

type AlbumCell struct {
	ImageSrc string
	Text     string
	Button1  string
	Button2  string
	Footnote string
}

type Alert

type Alert int
const (
	Primary Alert = iota
	Secondary
	Success
	Danger
	Warning
	Info
	Light
	Dark
)

func NewAlert

func NewAlert(idx int) Alert

func (Alert) Class

func (a Alert) Class() string

Class returns the class name of the alert ("Primary", "Secondary", ...).

func (Alert) String

func (a Alert) String() string

Class returns the class name of the alert ("Primary", "Secondary", ...).

type AlertColored

type AlertColored int
const (
	PrimaryC AlertColored = iota
	SecondaryC
	SuccessC
	DangerC
	WarningC
	InfoC
)

func NewAlertColored

func NewAlertColored(idx int) AlertColored

func (AlertColored) Class

func (a AlertColored) Class() string

Class returns the class name of the alert ("Primary", "Secondary", ...).

func (AlertColored) DivHTML added in v0.4.0

func (a AlertColored) DivHTML(innerHTML string) string

Class returns the class name of the alert ("Primary", "Secondary", ...).

func (AlertColored) String

func (a AlertColored) String() string

Class returns the class name of the alert ("Primary", "Secondary", ...).

type Column added in v0.4.0

type Column struct {
	ElementBase
	SizeDefaultWidth int
	SizeAllHidden    bool
	XsWidth          int
	XsHidden         bool
	SmWidth          int
	SmHidden         bool
	MdWidth          int
	MdHidden         bool
	LgWidth          int
	LgHidden         bool
}

func (*Column) Class added in v0.4.0

func (col *Column) Class() (string, error)

func (*Column) HTML added in v0.4.0

func (col *Column) HTML() (string, error)

type Element added in v0.4.0

type Element interface {
	HTML() (string, error)
}

type ElementBase added in v0.4.0

type ElementBase struct {
	AdditionalClasses    []string
	Style                string
	InnerHTML            []Element
	AdditionalProperties map[string]string
}

type Generic added in v0.4.0

type Generic struct {
	ElementBase
}

func (*Generic) Class added in v0.4.0

func (gen *Generic) Class() (string, error)

func (*Generic) HTML added in v0.4.0

func (gen *Generic) HTML() (string, error)
type Link struct {
	Href      string
	InnerHTML string
	Current   bool
	SubLinks  []Link
}
type Navbar struct {
	Title     Link
	MenuLinks []Link
	Search    Search
}
type Search struct {
	Action      string
	Method      string
	Onclick     string
	Placeholder string
	Text        string
}

type Webpage

type Webpage struct {
	Title    string
	Navbar   Navbar
	MainHTML string
}

func (*Webpage) FooterString

func (pg *Webpage) FooterString() string

func (*Webpage) MainString

func (pg *Webpage) MainString() string

func (*Webpage) NavbarString

func (pg *Webpage) NavbarString() string

Directories

Path Synopsis
nav command

Jump to

Keyboard shortcuts

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