gxhtml

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultCXfs

func DefaultCXfs() goxic.ContentXformers

func EscWrap

func EscWrap(cnt goxic.Content) goxic.Content

func FormatPh

func FormatPh(name string, mode goxic.PhWriteMode) string

func NewParser

func NewParser(cxfs goxic.ContentXformers) *goxic.Parser

Types

type Escaper

type Escaper struct {
	Cnt goxic.Content
}

func (Escaper) WriteTo

func (hc Escaper) WriteTo(wr io.Writer) (int64, error)

type Span

type Span struct {
	Wrapped goxic.Content
	// contains filtered or unexported fields
}

Span wraps content into a HTML <span></span> element

Example
out := os.Stdout
cnt := gxc.P("foo")
span := NewSpan(cnt, "", "")
span.WriteTo(out)
fmt.Fprintln(out)
span = NewSpan(cnt, "&ID", "")
span.WriteTo(out)
fmt.Fprintln(out)
span = NewSpan(cnt, "", "'CLS")
span.WriteTo(out)
fmt.Fprintln(out)
span = NewSpan(cnt, "&ID", "'CLS")
span.WriteTo(out)
fmt.Fprintln(out)
Output:

<span>foo</span>
<span id="&amp;ID">foo</span>
<span class="&#39;CLS">foo</span>
<span id="&amp;ID" class="&#39;CLS">foo</span>

func NewSpan

func NewSpan(around goxic.Content, spanId string, spanClass string) *Span

func (*Span) WriteTo

func (s *Span) WriteTo(wr io.Writer) (res int64, err error)

Jump to

Keyboard shortcuts

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