mjml

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToHTML

func ToHTML(ctx context.Context, mjmlSrc string, opts ...Option) (string, error)

ToHTML compiles MJML markup template to standard email-compatible HTML.

Types

type Compiler added in v0.0.4

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

Compiler is a fluent builder for MJML template compilation.

func Compile added in v0.0.4

func Compile(ctx context.Context, mjmlSrc string) *Compiler

Compile creates a new fluent Compiler with the provided MJML source.

func (*Compiler) Run added in v0.0.4

func (c *Compiler) Run() (string, error)

Run executes the compilation and returns the generated HTML.

func (*Compiler) WithBeautify added in v0.0.4

func (c *Compiler) WithBeautify(beautify bool) *Compiler

WithBeautify enables or disables HTML beautification.

func (*Compiler) WithKeepComments added in v0.0.4

func (c *Compiler) WithKeepComments(keepComments bool) *Compiler

WithKeepComments sets whether to keep XML/HTML comments in output.

func (*Compiler) WithMinify added in v0.0.4

func (c *Compiler) WithMinify(minify bool) *Compiler

WithMinify enables or disables HTML minification.

type Option

type Option func(*options)

Option represents functional options for MJML compilation.

func WithBeautify

func WithBeautify(beautify bool) Option

WithBeautify enables HTML beautification.

func WithKeepComments

func WithKeepComments(keepComments bool) Option

WithKeepComments keeps XML/HTML comments in output.

func WithMinify

func WithMinify(minify bool) Option

WithMinify enables HTML minification.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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