htmlwriter

package module
v0.0.0-...-ca4b958 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2013 License: MIT Imports: 4 Imported by: 0

README

HtmlWriter

The HtmlWriter is a struct that embeds an io.Writer and decorates it with a set of methods for generating HTML 5 documents.

It supports all the elements listed here

Stability

The API is new and should be considered unstable. Expect changes.

Installation

go get github.com/peterskeide/htmlwriter

Normal (non-void) elements

For most non-void element the HtmlWriter API exposes two methods; a normal method and an "underscore" method. For the body element that would be:

  • func (w *HtmlWriter) Body(attrs htmlwriter.Attrs, innerHtml func())
  • func (w *HtmlWriter) Body_(innerHtml func())

The "underscore" method makes the API a little less noisy when you need to generate elements without attributes (you don't have to pass a nil value for attrs everywhere).

The title, option and textarea elements are a bit different. They only support text, and cannot have child elements:

  • func (w *HtmlWriter) Title(attrs Attrs, formatStr string, a ...interface{})
  • func (w *HtmlWriter) Title_(formatStr string, a ...interface{})

Void elements

For every void element the HtmlWriter exposes the same two methods, but they do not accept a function for writing nested content. Using link as an example:

  • func (w *HtmlWriter) Link(attrs htmlwriter.Attrs)
  • func (w *HtmlWriter) Link_()

Attributes

Element attributes are generated by passing an instance of htmlwriter.Attrs to the element methods (this is a type alias for map[string]string).

writer.Link(htmlwriter.Attrs{"href": "http://www.example.com", "rel": "stylesheet", "type": "text/css"})

Text

To write element text to the Writer, use the Text method: writer.Text("lorem ipsum"). The Text method escapes HTML. If you don't want to escape HTML content, use the RawText method: writer.RawText("<div>foo</div>"). Both methods support format verbs via fmt.Sprintf.

  • func (w *HtmlWriter) Text(formatStr string, a ...interface{})
  • func (w *HtmlWriter) RawText(formatStr string, a ...interface{})

Child elements

Elements can have child elements by passing a closure to the element method:

writer.Body(htmlwriter.Attrs{"class": "demo"}, func() {
    writer.Div_(func() {
        writer.Text("lorem ipsum")
    })
})

Shortcut methods

The HtmlWriter has some methods to make it simpler to define attributes and text/raw text. Assuming the HtmlWriter variable is named w:

w.Div(w.Attrs("id=%s, class=test widget", id), func() {
    w.Button(w.Attrs("type=button"), w.TextF("Click me!"))
})

Available shortcut methods are:

  • func (w *HtmlWriter) TextF(formatStr string, a ...interface{}) func() // For writing text
  • func (w *HtmlWriter) RawTextF(formatStr string, a ...interface{}) func() // For writing unescaped text
  • func (w *HtmlWriter) Attrs(formatStringAttrs string, a ...interface{}) Attrs // For intializing htmlwriter.Attrs with attribute values

The Attrs method expects a string with a comma separated list of attributes, where the attribute name and value is separated by =. Example:

w.Attrs("id=content, class=first second")

For marker attributes such as checked, just use the name of the attribute without a value (and without =).

The attributes string can contain format verbs as defined in the fmt package.

Input methods

For every input type there are two methods that let you write an input element of that type to the Writer without explicitly declaring the type attribute. Using type email as an example:

  • func (w *HtmlWriter) EmailInput(attrs htmlwriter.Attrs)
  • func (w *HtmlWriter) EmailInput_()

Non-standard elements

The HtmlWriter exposes two lower level methods for writing elements. These can be used to write elements that are not part of the HTML spec, such as AngularJS directives.

The methods are:

  • func (w *HtmlWriter) WriteNormalElement(tagName string, attrs Attrs, innerHtml func()) // For writing elements with start and end tags
  • func (w *HtmlWriter) WriteVoidElement(tagName string, attrs Attrs) // For writing void elements (start tag only)

"Extras"

Finally, there are some methods that make common things a bit more concise:

  • func (w *HtmlWriter) Html5(attrs Attrs, innerHtml func()) // Writes a HTML5 doctype declaration and a html element
  • func (w *HtmlWriter) Html5_(innerHtml func()) // Same as above, but without attributes
  • func (w *HtmlWriter) StylesheetLink(href string) // Write a link to an external stylesheet
  • func (w *HtmlWriter) ExternalScript(src string) // Write a script element referencing an external javascript asset

Examples

A basic example of writing static HTML directly to the ResponseWriter:

func DemoHandler(res http.ResponseWriter, req *http.Request) {

    w := htmlwriter.NewHtmlWriter(res)

    w.Html5(w.Attrs("lang=en"), func() {
        w.Head_(func() {
            w.Title_("HtmlWriter Demo")
            w.StylesheetLink("assets/demo.css")
        })

        w.Body_(func() {
            w.Div(w.Attrs("class=main"), func() {
                w.Text("Hello ")
                w.Span_(w.TextF("World!"))
            })

            w.Form(w.Attrs("id=name-form, action=process"), func() {
                w.TextInput(w.Attrs("name=firstname"))
                w.SubmitInput(w.Attrs("value=Send name"))
            })
        })
    })
}

Building a simple templating system on top of the HtmlWriter (full program):

package main

import (
    "github.com/peterskeide/htmlwriter"
    "log"
    "net/http"
)

func main() {
    http.HandleFunc("/person", PersonHandler)
    http.HandleFunc("/persons", PersonListHandler)

    log.Println("Starting server on port 8000")
    log.Fatal(http.ListenAndServe(":8000", nil))
}

func PersonHandler(res http.ResponseWriter, req *http.Request) {
    pt := NewPersonTemplates(res)

    pt.title = "Person"
    pt.person = Person{"John Doe", 30}

    pt.Layout(pt.PersonTemplate)
}

func PersonListHandler(res http.ResponseWriter, req *http.Request) {
    pt := NewPersonTemplates(res)

    pt.title = "Person List"
    pt.persons = []Person{Person{"John Doe", 30}, Person{"Jane Doe", 28}}

    pt.Layout(pt.PersonListTemplate)
}

type Person struct {
    Name string
    Age  int
}

type PersonTemplates struct {
    *htmlwriter.HtmlWriter
    title   string
    person  Person
    persons []Person
}

func NewPersonTemplates(res http.ResponseWriter) (pt *PersonTemplates) {
    pt = new(PersonTemplates)
    pt.HtmlWriter = htmlwriter.NewHtmlWriter(res)
    return
}

func (pt *PersonTemplates) Layout(template func()) {
    pt.Html5_(func() {
        pt.Head_(func() {
            pt.Title_(pt.title)
        })

        pt.Body_(template)
    })
}

func (pt *PersonTemplates) PersonTemplate() {
    pt.Div(pt.Attrs("class=person"), func() {
        pt.Em_(pt.TextF(pt.person.Name))
        pt.Text(", age %d", pt.person.Age)
    })
}

func (pt *PersonTemplates) PersonListTemplate() {
    pt.Ul_(func() {
        for _, p := range pt.persons {
            pt.Li_(pt.TextF("%s (%d)", p.Name, p.Age))
        }
    })
}

By following the approach of the example above, it is very easy to build reusable widgets, form controls etc.

License (MIT)

Copyright (C) 2013 Peter Skeide

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attrs

type Attrs map[string]string

type HtmlWriter

type HtmlWriter struct {
	io.Writer
}

func NewHtmlWriter

func NewHtmlWriter(writer io.Writer) *HtmlWriter

func (*HtmlWriter) A

func (w *HtmlWriter) A(attrs Attrs, innerHtml func())

func (*HtmlWriter) A_

func (w *HtmlWriter) A_(innerHtml func())

func (*HtmlWriter) Abbr

func (w *HtmlWriter) Abbr(attrs Attrs, innerHtml func())

func (*HtmlWriter) Abbr_

func (w *HtmlWriter) Abbr_(innerHtml func())

func (*HtmlWriter) Address

func (w *HtmlWriter) Address(attrs Attrs, innerHtml func())

func (*HtmlWriter) Address_

func (w *HtmlWriter) Address_(innerHtml func())

func (*HtmlWriter) Area

func (w *HtmlWriter) Area(attrs Attrs)

func (*HtmlWriter) Area_

func (w *HtmlWriter) Area_()

func (*HtmlWriter) Article

func (w *HtmlWriter) Article(attrs Attrs, innerHtml func())

func (*HtmlWriter) Article_

func (w *HtmlWriter) Article_(innerHtml func())

func (*HtmlWriter) Aside

func (w *HtmlWriter) Aside(attrs Attrs, innerHtml func())

func (*HtmlWriter) Aside_

func (w *HtmlWriter) Aside_(innerHtml func())

func (*HtmlWriter) Attrs

func (b *HtmlWriter) Attrs(formatStringAttrs string, a ...interface{}) Attrs

func (*HtmlWriter) Audio

func (w *HtmlWriter) Audio(attrs Attrs, innerHtml func())

func (*HtmlWriter) Audio_

func (w *HtmlWriter) Audio_(innerHtml func())

func (*HtmlWriter) B

func (w *HtmlWriter) B(attrs Attrs, innerHtml func())

func (*HtmlWriter) B_

func (w *HtmlWriter) B_(innerHtml func())

func (*HtmlWriter) Base

func (w *HtmlWriter) Base(attrs Attrs)

func (*HtmlWriter) Base_

func (w *HtmlWriter) Base_()

func (*HtmlWriter) Bdi

func (w *HtmlWriter) Bdi(attrs Attrs, innerHtml func())

func (*HtmlWriter) Bdi_

func (w *HtmlWriter) Bdi_(innerHtml func())

func (*HtmlWriter) Bdo

func (w *HtmlWriter) Bdo(attrs Attrs, innerHtml func())

func (*HtmlWriter) Bdo_

func (w *HtmlWriter) Bdo_(innerHtml func())

func (*HtmlWriter) Blockquote

func (w *HtmlWriter) Blockquote(attrs Attrs, innerHtml func())

func (*HtmlWriter) Blockquote_

func (w *HtmlWriter) Blockquote_(innerHtml func())

func (*HtmlWriter) Body

func (w *HtmlWriter) Body(attrs Attrs, innerHtml func())

func (*HtmlWriter) Body_

func (w *HtmlWriter) Body_(innerHtml func())

func (*HtmlWriter) Br

func (w *HtmlWriter) Br(attrs Attrs)

func (*HtmlWriter) Br_

func (w *HtmlWriter) Br_()

func (*HtmlWriter) Button

func (w *HtmlWriter) Button(attrs Attrs, innerHtml func())

func (*HtmlWriter) ButtonInput

func (w *HtmlWriter) ButtonInput(attrs Attrs)

func (*HtmlWriter) ButtonInput_

func (w *HtmlWriter) ButtonInput_()

func (*HtmlWriter) Button_

func (w *HtmlWriter) Button_(innerHtml func())

func (*HtmlWriter) Canvas

func (w *HtmlWriter) Canvas(attrs Attrs, innerHtml func())

func (*HtmlWriter) Canvas_

func (w *HtmlWriter) Canvas_(innerHtml func())

func (*HtmlWriter) Caption

func (w *HtmlWriter) Caption(attrs Attrs, innerHtml func())

func (*HtmlWriter) Caption_

func (w *HtmlWriter) Caption_(innerHtml func())

func (*HtmlWriter) CheckboxInput

func (w *HtmlWriter) CheckboxInput(attrs Attrs)

func (*HtmlWriter) CheckboxInput_

func (w *HtmlWriter) CheckboxInput_()

func (*HtmlWriter) Cite

func (w *HtmlWriter) Cite(attrs Attrs, innerHtml func())

func (*HtmlWriter) Cite_

func (w *HtmlWriter) Cite_(innerHtml func())

func (*HtmlWriter) Code

func (w *HtmlWriter) Code(attrs Attrs, innerHtml func())

func (*HtmlWriter) Code_

func (w *HtmlWriter) Code_(innerHtml func())

func (*HtmlWriter) Col

func (w *HtmlWriter) Col(attrs Attrs)

func (*HtmlWriter) Col_

func (w *HtmlWriter) Col_()

func (*HtmlWriter) Colgroup

func (w *HtmlWriter) Colgroup(attrs Attrs, innerHtml func())

func (*HtmlWriter) Colgroup_

func (w *HtmlWriter) Colgroup_(innerHtml func())

func (*HtmlWriter) ColorInput

func (w *HtmlWriter) ColorInput(attrs Attrs)

func (*HtmlWriter) ColorInput_

func (w *HtmlWriter) ColorInput_()

func (*HtmlWriter) Command

func (w *HtmlWriter) Command(attrs Attrs)

func (*HtmlWriter) Command_

func (w *HtmlWriter) Command_()

func (*HtmlWriter) Data

func (w *HtmlWriter) Data(attrs Attrs, innerHtml func())

func (*HtmlWriter) Data_

func (w *HtmlWriter) Data_(innerHtml func())

func (*HtmlWriter) Datalist

func (w *HtmlWriter) Datalist(attrs Attrs, innerHtml func())

func (*HtmlWriter) Datalist_

func (w *HtmlWriter) Datalist_(innerHtml func())

func (*HtmlWriter) DateInput

func (w *HtmlWriter) DateInput(attrs Attrs)

func (*HtmlWriter) DateInput_

func (w *HtmlWriter) DateInput_()

func (*HtmlWriter) DatetimeInput

func (w *HtmlWriter) DatetimeInput(attrs Attrs)

func (*HtmlWriter) DatetimeInput_

func (w *HtmlWriter) DatetimeInput_()

func (*HtmlWriter) DatetimeLocalInput

func (w *HtmlWriter) DatetimeLocalInput(attrs Attrs)

func (*HtmlWriter) DatetimeLocalInput_

func (w *HtmlWriter) DatetimeLocalInput_()

func (*HtmlWriter) Dd

func (w *HtmlWriter) Dd(attrs Attrs, innerHtml func())

func (*HtmlWriter) Dd_

func (w *HtmlWriter) Dd_(innerHtml func())

func (*HtmlWriter) Del

func (w *HtmlWriter) Del(attrs Attrs, innerHtml func())

func (*HtmlWriter) Del_

func (w *HtmlWriter) Del_(innerHtml func())

func (*HtmlWriter) Details

func (w *HtmlWriter) Details(attrs Attrs, innerHtml func())

func (*HtmlWriter) Details_

func (w *HtmlWriter) Details_(innerHtml func())

func (*HtmlWriter) Dfn

func (w *HtmlWriter) Dfn(attrs Attrs, innerHtml func())

func (*HtmlWriter) Dfn_

func (w *HtmlWriter) Dfn_(innerHtml func())

func (*HtmlWriter) Div

func (w *HtmlWriter) Div(attrs Attrs, innerHtml func())

func (*HtmlWriter) Div_

func (w *HtmlWriter) Div_(innerHtml func())

func (*HtmlWriter) Dl

func (w *HtmlWriter) Dl(attrs Attrs, innerHtml func())

func (*HtmlWriter) Dl_

func (w *HtmlWriter) Dl_(innerHtml func())

func (*HtmlWriter) Dt

func (w *HtmlWriter) Dt(attrs Attrs, innerHtml func())

func (*HtmlWriter) Dt_

func (w *HtmlWriter) Dt_(innerHtml func())

func (*HtmlWriter) Em

func (w *HtmlWriter) Em(attrs Attrs, innerHtml func())

func (*HtmlWriter) Em_

func (w *HtmlWriter) Em_(innerHtml func())

func (*HtmlWriter) EmailInput

func (w *HtmlWriter) EmailInput(attrs Attrs)

func (*HtmlWriter) EmailInput_

func (w *HtmlWriter) EmailInput_()

func (*HtmlWriter) Embed

func (w *HtmlWriter) Embed(attrs Attrs)

func (*HtmlWriter) Embed_

func (w *HtmlWriter) Embed_()

func (*HtmlWriter) ExternalScript

func (b *HtmlWriter) ExternalScript(src string)

func (*HtmlWriter) Fieldset

func (w *HtmlWriter) Fieldset(attrs Attrs, innerHtml func())

func (*HtmlWriter) Fieldset_

func (w *HtmlWriter) Fieldset_(innerHtml func())

func (*HtmlWriter) Figcaption

func (w *HtmlWriter) Figcaption(attrs Attrs, innerHtml func())

func (*HtmlWriter) Figcaption_

func (w *HtmlWriter) Figcaption_(innerHtml func())

func (*HtmlWriter) Figure

func (w *HtmlWriter) Figure(attrs Attrs, innerHtml func())

func (*HtmlWriter) Figure_

func (w *HtmlWriter) Figure_(innerHtml func())

func (*HtmlWriter) FileInput

func (w *HtmlWriter) FileInput(attrs Attrs)

func (*HtmlWriter) FileInput_

func (w *HtmlWriter) FileInput_()

func (*HtmlWriter) Footer

func (w *HtmlWriter) Footer(attrs Attrs, innerHtml func())

func (*HtmlWriter) Footer_

func (w *HtmlWriter) Footer_(innerHtml func())

func (*HtmlWriter) Form

func (w *HtmlWriter) Form(attrs Attrs, innerHtml func())

func (*HtmlWriter) Form_

func (w *HtmlWriter) Form_(innerHtml func())

func (*HtmlWriter) H1

func (w *HtmlWriter) H1(attrs Attrs, innerHtml func())

func (*HtmlWriter) H1_

func (w *HtmlWriter) H1_(innerHtml func())

func (*HtmlWriter) H2

func (w *HtmlWriter) H2(attrs Attrs, innerHtml func())

func (*HtmlWriter) H2_

func (w *HtmlWriter) H2_(innerHtml func())

func (*HtmlWriter) H3

func (w *HtmlWriter) H3(attrs Attrs, innerHtml func())

func (*HtmlWriter) H3_

func (w *HtmlWriter) H3_(innerHtml func())

func (*HtmlWriter) H4

func (w *HtmlWriter) H4(attrs Attrs, innerHtml func())

func (*HtmlWriter) H4_

func (w *HtmlWriter) H4_(innerHtml func())

func (*HtmlWriter) H5

func (w *HtmlWriter) H5(attrs Attrs, innerHtml func())

func (*HtmlWriter) H5_

func (w *HtmlWriter) H5_(innerHtml func())

func (*HtmlWriter) H6

func (w *HtmlWriter) H6(attrs Attrs, innerHtml func())

func (*HtmlWriter) H6_

func (w *HtmlWriter) H6_(innerHtml func())

func (*HtmlWriter) Head

func (w *HtmlWriter) Head(attrs Attrs, innerHtml func())

func (*HtmlWriter) Head_

func (w *HtmlWriter) Head_(innerHtml func())

func (*HtmlWriter) Header

func (w *HtmlWriter) Header(attrs Attrs, innerHtml func())

func (*HtmlWriter) Header_

func (w *HtmlWriter) Header_(innerHtml func())

func (*HtmlWriter) HiddenInput

func (w *HtmlWriter) HiddenInput(attrs Attrs)

func (*HtmlWriter) HiddenInput_

func (w *HtmlWriter) HiddenInput_()

func (*HtmlWriter) Hr

func (w *HtmlWriter) Hr(attrs Attrs)

func (*HtmlWriter) Hr_

func (w *HtmlWriter) Hr_()

func (*HtmlWriter) Html

func (w *HtmlWriter) Html(attrs Attrs, innerHtml func())

func (*HtmlWriter) Html5

func (b *HtmlWriter) Html5(attrs Attrs, innerHtml func())

func (*HtmlWriter) Html5_

func (b *HtmlWriter) Html5_(innerHtml func())

func (*HtmlWriter) Html_

func (w *HtmlWriter) Html_(innerHtml func())

func (*HtmlWriter) I

func (w *HtmlWriter) I(attrs Attrs, innerHtml func())

func (*HtmlWriter) I_

func (w *HtmlWriter) I_(innerHtml func())

func (*HtmlWriter) Iframe

func (w *HtmlWriter) Iframe(attrs Attrs, innerHtml func())

func (*HtmlWriter) Iframe_

func (w *HtmlWriter) Iframe_(innerHtml func())

func (*HtmlWriter) ImageInput

func (w *HtmlWriter) ImageInput(attrs Attrs)

func (*HtmlWriter) ImageInput_

func (w *HtmlWriter) ImageInput_()

func (*HtmlWriter) Img

func (w *HtmlWriter) Img(attrs Attrs)

func (*HtmlWriter) Img_

func (w *HtmlWriter) Img_()

func (*HtmlWriter) Input

func (w *HtmlWriter) Input(attrs Attrs)

func (*HtmlWriter) Input_

func (w *HtmlWriter) Input_()

func (*HtmlWriter) Ins

func (w *HtmlWriter) Ins(attrs Attrs, innerHtml func())

func (*HtmlWriter) Ins_

func (w *HtmlWriter) Ins_(innerHtml func())

func (*HtmlWriter) Kbd

func (w *HtmlWriter) Kbd(attrs Attrs, innerHtml func())

func (*HtmlWriter) Kbd_

func (w *HtmlWriter) Kbd_(innerHtml func())

func (*HtmlWriter) Keygen

func (w *HtmlWriter) Keygen(attrs Attrs)

func (*HtmlWriter) Keygen_

func (w *HtmlWriter) Keygen_()

func (*HtmlWriter) Label

func (w *HtmlWriter) Label(attrs Attrs, innerHtml func())

func (*HtmlWriter) Label_

func (w *HtmlWriter) Label_(innerHtml func())

func (*HtmlWriter) Legend

func (w *HtmlWriter) Legend(attrs Attrs, innerHtml func())

func (*HtmlWriter) Legend_

func (w *HtmlWriter) Legend_(innerHtml func())

func (*HtmlWriter) Li

func (w *HtmlWriter) Li(attrs Attrs, innerHtml func())

func (*HtmlWriter) Li_

func (w *HtmlWriter) Li_(innerHtml func())
func (w *HtmlWriter) Link(attrs Attrs)
func (w *HtmlWriter) Link_()

func (*HtmlWriter) Main

func (w *HtmlWriter) Main(attrs Attrs, innerHtml func())

func (*HtmlWriter) Main_

func (w *HtmlWriter) Main_(innerHtml func())

func (*HtmlWriter) Map

func (w *HtmlWriter) Map(attrs Attrs, innerHtml func())

func (*HtmlWriter) Map_

func (w *HtmlWriter) Map_(innerHtml func())

func (*HtmlWriter) Mark

func (w *HtmlWriter) Mark(attrs Attrs, innerHtml func())

func (*HtmlWriter) Mark_

func (w *HtmlWriter) Mark_(innerHtml func())

func (*HtmlWriter) Math

func (w *HtmlWriter) Math(attrs Attrs, innerHtml func())

func (*HtmlWriter) Math_

func (w *HtmlWriter) Math_(innerHtml func())

func (*HtmlWriter) Menu

func (w *HtmlWriter) Menu(attrs Attrs, innerHtml func())

func (*HtmlWriter) Menu_

func (w *HtmlWriter) Menu_(innerHtml func())

func (*HtmlWriter) Meta

func (w *HtmlWriter) Meta(attrs Attrs)

func (*HtmlWriter) Meta_

func (w *HtmlWriter) Meta_()

func (*HtmlWriter) Meter

func (w *HtmlWriter) Meter(attrs Attrs, innerHtml func())

func (*HtmlWriter) Meter_

func (w *HtmlWriter) Meter_(innerHtml func())

func (*HtmlWriter) MonthInput

func (w *HtmlWriter) MonthInput(attrs Attrs)

func (*HtmlWriter) MonthInput_

func (w *HtmlWriter) MonthInput_()

func (*HtmlWriter) Nav

func (w *HtmlWriter) Nav(attrs Attrs, innerHtml func())

func (*HtmlWriter) Nav_

func (w *HtmlWriter) Nav_(innerHtml func())

func (*HtmlWriter) Noscript

func (w *HtmlWriter) Noscript(attrs Attrs, innerHtml func())

func (*HtmlWriter) Noscript_

func (w *HtmlWriter) Noscript_(innerHtml func())

func (*HtmlWriter) NumberInput

func (w *HtmlWriter) NumberInput(attrs Attrs)

func (*HtmlWriter) NumberInput_

func (w *HtmlWriter) NumberInput_()

func (*HtmlWriter) Object

func (w *HtmlWriter) Object(attrs Attrs, innerHtml func())

func (*HtmlWriter) Object_

func (w *HtmlWriter) Object_(innerHtml func())

func (*HtmlWriter) Ol

func (w *HtmlWriter) Ol(attrs Attrs, innerHtml func())

func (*HtmlWriter) Ol_

func (w *HtmlWriter) Ol_(innerHtml func())

func (*HtmlWriter) Optgroup

func (w *HtmlWriter) Optgroup(attrs Attrs, innerHtml func())

func (*HtmlWriter) Optgroup_

func (w *HtmlWriter) Optgroup_(innerHtml func())

func (*HtmlWriter) Option

func (w *HtmlWriter) Option(attrs Attrs, formatStr string, a ...interface{})

func (*HtmlWriter) Option_

func (w *HtmlWriter) Option_(formatStr string, a ...interface{})

func (*HtmlWriter) Output

func (w *HtmlWriter) Output(attrs Attrs, innerHtml func())

func (*HtmlWriter) Output_

func (w *HtmlWriter) Output_(innerHtml func())

func (*HtmlWriter) P

func (w *HtmlWriter) P(attrs Attrs, innerHtml func())

func (*HtmlWriter) P_

func (w *HtmlWriter) P_(innerHtml func())

func (*HtmlWriter) Param

func (w *HtmlWriter) Param(attrs Attrs)

func (*HtmlWriter) Param_

func (w *HtmlWriter) Param_()

func (*HtmlWriter) PasswordInput

func (w *HtmlWriter) PasswordInput(attrs Attrs)

func (*HtmlWriter) PasswordInput_

func (w *HtmlWriter) PasswordInput_()

func (*HtmlWriter) Pre

func (w *HtmlWriter) Pre(attrs Attrs, innerHtml func())

func (*HtmlWriter) Pre_

func (w *HtmlWriter) Pre_(innerHtml func())

func (*HtmlWriter) Progress

func (w *HtmlWriter) Progress(attrs Attrs, innerHtml func())

func (*HtmlWriter) Progress_

func (w *HtmlWriter) Progress_(innerHtml func())

func (*HtmlWriter) Q

func (w *HtmlWriter) Q(attrs Attrs, innerHtml func())

func (*HtmlWriter) Q_

func (w *HtmlWriter) Q_(innerHtml func())

func (*HtmlWriter) RadioInput

func (w *HtmlWriter) RadioInput(attrs Attrs)

func (*HtmlWriter) RadioInput_

func (w *HtmlWriter) RadioInput_()

func (*HtmlWriter) RangeInput

func (w *HtmlWriter) RangeInput(attrs Attrs)

func (*HtmlWriter) RangeInput_

func (w *HtmlWriter) RangeInput_()

func (*HtmlWriter) RawText

func (b *HtmlWriter) RawText(formatStr string, a ...interface{})

func (*HtmlWriter) RawTextF

func (b *HtmlWriter) RawTextF(formatStr string, a ...interface{}) func()

func (*HtmlWriter) ResetInput

func (w *HtmlWriter) ResetInput(attrs Attrs)

func (*HtmlWriter) ResetInput_

func (w *HtmlWriter) ResetInput_()

func (*HtmlWriter) Rp

func (w *HtmlWriter) Rp(attrs Attrs, innerHtml func())

func (*HtmlWriter) Rp_

func (w *HtmlWriter) Rp_(innerHtml func())

func (*HtmlWriter) Rt

func (w *HtmlWriter) Rt(attrs Attrs, innerHtml func())

func (*HtmlWriter) Rt_

func (w *HtmlWriter) Rt_(innerHtml func())

func (*HtmlWriter) Ruby

func (w *HtmlWriter) Ruby(attrs Attrs, innerHtml func())

func (*HtmlWriter) Ruby_

func (w *HtmlWriter) Ruby_(innerHtml func())

func (*HtmlWriter) S

func (w *HtmlWriter) S(attrs Attrs, innerHtml func())

func (*HtmlWriter) S_

func (w *HtmlWriter) S_(innerHtml func())

func (*HtmlWriter) Samp

func (w *HtmlWriter) Samp(attrs Attrs, innerHtml func())

func (*HtmlWriter) Samp_

func (w *HtmlWriter) Samp_(innerHtml func())

func (*HtmlWriter) Script

func (w *HtmlWriter) Script(attrs Attrs, innerHtml func())

func (*HtmlWriter) Script_

func (w *HtmlWriter) Script_(innerHtml func())

func (*HtmlWriter) SearchInput

func (w *HtmlWriter) SearchInput(attrs Attrs)

func (*HtmlWriter) SearchInput_

func (w *HtmlWriter) SearchInput_()

func (*HtmlWriter) Section

func (w *HtmlWriter) Section(attrs Attrs, innerHtml func())

func (*HtmlWriter) Section_

func (w *HtmlWriter) Section_(innerHtml func())

func (*HtmlWriter) Select

func (w *HtmlWriter) Select(attrs Attrs, innerHtml func())

func (*HtmlWriter) Select_

func (w *HtmlWriter) Select_(innerHtml func())

func (*HtmlWriter) Small

func (w *HtmlWriter) Small(attrs Attrs, innerHtml func())

func (*HtmlWriter) Small_

func (w *HtmlWriter) Small_(innerHtml func())

func (*HtmlWriter) Source

func (w *HtmlWriter) Source(attrs Attrs)

func (*HtmlWriter) Source_

func (w *HtmlWriter) Source_()

func (*HtmlWriter) Span

func (w *HtmlWriter) Span(attrs Attrs, innerHtml func())

func (*HtmlWriter) Span_

func (w *HtmlWriter) Span_(innerHtml func())

func (*HtmlWriter) Strong

func (w *HtmlWriter) Strong(attrs Attrs, innerHtml func())

func (*HtmlWriter) Strong_

func (w *HtmlWriter) Strong_(innerHtml func())

func (*HtmlWriter) Style

func (w *HtmlWriter) Style(attrs Attrs, innerHtml func())

func (*HtmlWriter) Style_

func (w *HtmlWriter) Style_(innerHtml func())
func (b *HtmlWriter) StylesheetLink(href string)

func (*HtmlWriter) Sub

func (w *HtmlWriter) Sub(attrs Attrs, innerHtml func())

func (*HtmlWriter) Sub_

func (w *HtmlWriter) Sub_(innerHtml func())

func (*HtmlWriter) SubmitInput

func (w *HtmlWriter) SubmitInput(attrs Attrs)

func (*HtmlWriter) SubmitInput_

func (w *HtmlWriter) SubmitInput_()

func (*HtmlWriter) Summary

func (w *HtmlWriter) Summary(attrs Attrs, innerHtml func())

func (*HtmlWriter) Summary_

func (w *HtmlWriter) Summary_(innerHtml func())

func (*HtmlWriter) Sup

func (w *HtmlWriter) Sup(attrs Attrs, innerHtml func())

func (*HtmlWriter) Sup_

func (w *HtmlWriter) Sup_(innerHtml func())

func (*HtmlWriter) Svg

func (w *HtmlWriter) Svg(attrs Attrs, innerHtml func())

func (*HtmlWriter) Svg_

func (w *HtmlWriter) Svg_(innerHtml func())

func (*HtmlWriter) Table

func (w *HtmlWriter) Table(attrs Attrs, innerHtml func())

func (*HtmlWriter) Table_

func (w *HtmlWriter) Table_(innerHtml func())

func (*HtmlWriter) Tbody

func (w *HtmlWriter) Tbody(attrs Attrs, innerHtml func())

func (*HtmlWriter) Tbody_

func (w *HtmlWriter) Tbody_(innerHtml func())

func (*HtmlWriter) Td

func (w *HtmlWriter) Td(attrs Attrs, innerHtml func())

func (*HtmlWriter) Td_

func (w *HtmlWriter) Td_(innerHtml func())

func (*HtmlWriter) TelInput

func (w *HtmlWriter) TelInput(attrs Attrs)

func (*HtmlWriter) TelInput_

func (w *HtmlWriter) TelInput_()

func (*HtmlWriter) Text

func (b *HtmlWriter) Text(formatStr string, a ...interface{})

func (*HtmlWriter) TextF

func (b *HtmlWriter) TextF(formatStr string, a ...interface{}) func()

func (*HtmlWriter) TextInput

func (w *HtmlWriter) TextInput(attrs Attrs)

func (*HtmlWriter) TextInput_

func (w *HtmlWriter) TextInput_()

func (*HtmlWriter) Textarea

func (w *HtmlWriter) Textarea(attrs Attrs, formatStr string, a ...interface{})

func (*HtmlWriter) Textarea_

func (w *HtmlWriter) Textarea_(formatStr string, a ...interface{})

func (*HtmlWriter) Tfoot

func (w *HtmlWriter) Tfoot(attrs Attrs, innerHtml func())

func (*HtmlWriter) Tfoot_

func (w *HtmlWriter) Tfoot_(innerHtml func())

func (*HtmlWriter) Th

func (w *HtmlWriter) Th(attrs Attrs, innerHtml func())

func (*HtmlWriter) Th_

func (w *HtmlWriter) Th_(innerHtml func())

func (*HtmlWriter) Thead

func (w *HtmlWriter) Thead(attrs Attrs, innerHtml func())

func (*HtmlWriter) Thead_

func (w *HtmlWriter) Thead_(innerHtml func())

func (*HtmlWriter) Time

func (w *HtmlWriter) Time(attrs Attrs, innerHtml func())

func (*HtmlWriter) TimeInput

func (w *HtmlWriter) TimeInput(attrs Attrs)

func (*HtmlWriter) TimeInput_

func (w *HtmlWriter) TimeInput_()

func (*HtmlWriter) Time_

func (w *HtmlWriter) Time_(innerHtml func())

func (*HtmlWriter) Title

func (w *HtmlWriter) Title(attrs Attrs, formatStr string, a ...interface{})

func (*HtmlWriter) Title_

func (w *HtmlWriter) Title_(formatStr string, a ...interface{})

func (*HtmlWriter) Tr

func (w *HtmlWriter) Tr(attrs Attrs, innerHtml func())

func (*HtmlWriter) Tr_

func (w *HtmlWriter) Tr_(innerHtml func())

func (*HtmlWriter) Track

func (w *HtmlWriter) Track(attrs Attrs)

func (*HtmlWriter) Track_

func (w *HtmlWriter) Track_()

func (*HtmlWriter) U

func (w *HtmlWriter) U(attrs Attrs, innerHtml func())

func (*HtmlWriter) U_

func (w *HtmlWriter) U_(innerHtml func())

func (*HtmlWriter) Ul

func (w *HtmlWriter) Ul(attrs Attrs, innerHtml func())

func (*HtmlWriter) Ul_

func (w *HtmlWriter) Ul_(innerHtml func())

func (*HtmlWriter) UrlInput

func (w *HtmlWriter) UrlInput(attrs Attrs)

func (*HtmlWriter) UrlInput_

func (w *HtmlWriter) UrlInput_()

func (*HtmlWriter) Var

func (w *HtmlWriter) Var(attrs Attrs, innerHtml func())

func (*HtmlWriter) Var_

func (w *HtmlWriter) Var_(innerHtml func())

func (*HtmlWriter) Video

func (w *HtmlWriter) Video(attrs Attrs, innerHtml func())

func (*HtmlWriter) Video_

func (w *HtmlWriter) Video_(innerHtml func())

func (*HtmlWriter) Wbr

func (w *HtmlWriter) Wbr(attrs Attrs)

func (*HtmlWriter) Wbr_

func (w *HtmlWriter) Wbr_()

func (*HtmlWriter) WeekInput

func (w *HtmlWriter) WeekInput(attrs Attrs)

func (*HtmlWriter) WeekInput_

func (w *HtmlWriter) WeekInput_()

func (*HtmlWriter) WriteNormalElement

func (b *HtmlWriter) WriteNormalElement(tagName string, attrs Attrs, innerHtml func())

func (*HtmlWriter) WriteString

func (b *HtmlWriter) WriteString(str string)

func (*HtmlWriter) WriteVoidElement

func (b *HtmlWriter) WriteVoidElement(tagName string, attrs Attrs)

Jump to

Keyboard shortcuts

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