txt

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Language

func Language(ctx context.Context) string

func WithLanguage

func WithLanguage(ctx context.Context, lang string) context.Context

Types

type RenderOptions

type RenderOptions struct {
	Lang string

	// Sanitize strips malicious code from untrusted HTML, not needed for trusted input.
	Sanitize bool

	// StripTags strips all HTML tags.
	StripTags bool
}

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

func NewRenderer

func NewRenderer() *Renderer

func (*Renderer) MustRenderLang

func (r *Renderer) MustRenderLang(ctx context.Context, source string, opts ...func(o *RenderOptions)) string

func (*Renderer) Render

func (r *Renderer) Render(source string, opts ...func(o *RenderOptions)) (string, error)

func (*Renderer) RenderLang

func (r *Renderer) RenderLang(ctx context.Context, source string, opts ...func(o *RenderOptions)) (string, error)

func (*Renderer) TxtRenderer

func (r *Renderer) TxtRenderer() *Renderer

Jump to

Keyboard shortcuts

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