printer

package
v0.0.0-...-e64b6cb Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const PrintPath = "!print"

Variables

This section is empty.

Functions

func Middleware

func Middleware(next http.Handler) http.Handler

Types

type NamedTag

type NamedTag struct {
	Name string
	Tag
}

func (*NamedTag) Build

func (t *NamedTag) Build() *h.HTMLTagBuilder

type Printer

type Printer struct {
	PrintButton string
	Title       string
	Lang        string
	Metas       []*Tag
	Styles      []*Tag
	Scripts     []*Tag
	PreBody     []*NamedTag
	Body        string
	PostBody    []*NamedTag
}

func ParseJSON

func ParseJSON(r io.Reader) (p *Printer, err error)

func ParseRequest

func ParseRequest(r *http.Request) (p *Printer, err error)

func ParseRequestType

func ParseRequestType(contentType string, values url.Values, r io.Reader) (p *Printer, err error)

func ParseValues

func ParseValues(values url.Values) (p *Printer, err error)

func ParseYAML

func ParseYAML(r io.Reader) (p *Printer, err error)

func (*Printer) Component

func (p *Printer) Component() h.HTMLComponent

func (*Printer) ParseValues

func (p *Printer) ParseValues(values url.Values) (err error)

type Tag

type Tag struct {
	// Attributes is a list of attributes. The attribute is pairs of attribute name and attribute value.
	// For boolean attributes, must set key of then (`len(attribute) == 1`).
	Attributes [][]string
	Content    string
}

TagAttibutes this is a map of attributes

func (*Tag) Build

func (t *Tag) Build(b *h.HTMLTagBuilder) *h.HTMLTagBuilder

Jump to

Keyboard shortcuts

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