html

package
v0.0.0-...-6868862 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

mae.earth/pkg/card/html/html.go * mae 012018

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadData      = errors.New("Bad Data")
	ErrBadCard      = errors.New("Bad Card")
	ErrBadAttribute = errors.New("Bad Attribute")
)

Functions

func GenerateForm

func GenerateForm(v *card.Card, options *FormOptions) (template.HTML, error)

GenerateForm

func ParseAsRadio

func ParseAsRadio(form *FormAttribute, com *card.Compound, options *FormOptions) (string, error)

func ParseAsSelect

func ParseAsSelect(form *FormAttribute, com *card.Compound, options *FormOptions) (string, error)

Types

type FormAttribute

type FormAttribute struct {
	Name    string
	Element string
}

func ParseFormElement

func ParseFormElement(str string) (*FormAttribute, error)

type FormButton

type FormButton struct {
	Type  string
	Label string
}

type FormDisabled

type FormDisabled map[string]bool

func (FormDisabled) Is

func (fd FormDisabled) Is(name string) string

type FormOptions

type FormOptions struct {
	Method string
	Action string

	User     FormUser
	Disabled FormDisabled

	Buttons []FormButton
}

type FormUser

type FormUser map[string]string

func (FormUser) Get

func (fu FormUser) Get(name, def string) string

Jump to

Keyboard shortcuts

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