Documentation ¶
Index ¶
- func SetMaxWorkers(maxSize int32) error
- func ToHTML(ctx context.Context, mjml string, toHTMLOptions ...ToHTMLOption) (string, error)
- type BeautifyBraceStyle
- type BeautifyIndentScripts
- type BeautifyOptions
- type BeautifyTemplating
- type BeautifyWrapAttributes
- type Error
- type Fonts
- type HTMLMinifierOptions
- type HTMLMinifierQuoteCharacter
- type JuiceOptions
- type JuiceTag
- type ToHTMLOption
- func WithBeautify(beautify bool) ToHTMLOption
- func WithBeautifyOptions(bOptions BeautifyOptions) ToHTMLOption
- func WithFonts(fonts Fonts) ToHTMLOption
- func WithJuiceOptions(jOptions JuiceOptions) ToHTMLOption
- func WithJuicePreserveTags(preserveTags map[string]JuiceTag) ToHTMLOption
- func WithKeepComments(keepComments bool) ToHTMLOption
- func WithMinify(minify bool) ToHTMLOption
- func WithMinifyOptions(minifyOptions HTMLMinifierOptions) ToHTMLOption
- func WithPreprocessors(preprocessors []string) ToHTMLOption
- func WithValidationLevel(validationLevel ValidationLevel) ToHTMLOption
- type ValidationLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetMaxWorkers ¶ added in v0.2.0
Types ¶
type BeautifyBraceStyle ¶
type BeautifyBraceStyle string
const ( BeautifyBraceStyleCollapsePreserveInline BeautifyBraceStyle = "collapse-preserve-inline" BeautifyBraceStyleCollapse BeautifyBraceStyle = "collapse" BeautifyBraceStyleExpand BeautifyBraceStyle = "expand" BeautifyBraceStyleEndExpand BeautifyBraceStyle = "end-expand" BeautifyBraceStyleNone BeautifyBraceStyle = "none" )
type BeautifyIndentScripts ¶
type BeautifyIndentScripts string
const ( BeautifyIndentScriptsKeep BeautifyIndentScripts = "keep" BeautifyIndentScriptsSeparate BeautifyIndentScripts = "separate" BeautifyIndentScriptsNormal BeautifyIndentScripts = "normal" )
type BeautifyOptions ¶
type BeautifyOptions interface { IndentSize(uint) BeautifyOptions IndentChar(string) BeautifyOptions IndentWithTabs(bool) BeautifyOptions Eol(string) BeautifyOptions EndWithNewline(bool) BeautifyOptions PreserveNewlines(bool) BeautifyOptions MaxPreserveNewlines(uint) BeautifyOptions IndentInnerHtml(bool) BeautifyOptions BraceStyle(BeautifyBraceStyle) BeautifyOptions IndentScripts(BeautifyIndentScripts) BeautifyOptions WrapLineLength(uint) BeautifyOptions WrapAttributes(BeautifyWrapAttributes) BeautifyOptions WrapAttributesIndentSize(uint) BeautifyOptions Inline([]string) BeautifyOptions Unformatted([]string) BeautifyOptions ContentUnformatted([]string) BeautifyOptions ExtraLiners([]string) BeautifyOptions UnformattedContentDelimiter(string) BeautifyOptions IndentEmptyLines(bool) BeautifyOptions Templating([]BeautifyTemplating) BeautifyOptions }
BeautifyOptions is used to construct Beautify options to be passed to the MJML compiler Detailed explanations of the options are here: https://github.com/beautify-web/js-beautify#css--html
func NewBeautifyOptions ¶
func NewBeautifyOptions() BeautifyOptions
type BeautifyTemplating ¶
type BeautifyTemplating string
const ( BeautifyTemplatingAuto BeautifyTemplating = "auto" BeautifyTemplatingNone BeautifyTemplating = "none" BeautifyTemplatingDjango BeautifyTemplating = "django" BeautifyTemplatingERB BeautifyTemplating = "erb" BeautifyTemplatingHandlebars BeautifyTemplating = "handlebars" BeautifyTemplatingPHP BeautifyTemplating = "php" BeautifyTemplatingSmarty BeautifyTemplating = "smarty" )
type BeautifyWrapAttributes ¶
type BeautifyWrapAttributes string
const ( BeautifyWrapAttributesAuto BeautifyWrapAttributes = "auto" BeautifyWrapAttributesForce BeautifyWrapAttributes = "force" BeautifyWrapAttributesForceAligned BeautifyWrapAttributes = "force-aligned" BeautifyWrapAttributesForceExpandMultiline BeautifyWrapAttributes = "force-expand-multiline" BeautifyWrapAttributesAlignedMultiple BeautifyWrapAttributes = "aligned-multiple" BeautifyWrapAttributesPreserve BeautifyWrapAttributes = "preserve" BeautifyWrapAttributesPreserveAligned BeautifyWrapAttributes = "preserved-aligned" )
type Error ¶
type HTMLMinifierOptions ¶
type HTMLMinifierOptions interface { CaseSensitive(bool) HTMLMinifierOptions CollapseBooleanAttributes(bool) HTMLMinifierOptions CollapseInlineTagWhitespace(bool) HTMLMinifierOptions CollapseWhitespace(bool) HTMLMinifierOptions ConservativeCollapse(bool) HTMLMinifierOptions ContinueOnParseError(bool) HTMLMinifierOptions CustomAttrAssign([]string) HTMLMinifierOptions CustomAttrCollapse(string) HTMLMinifierOptions CustomAttrSurround([]string) HTMLMinifierOptions DecodeEntities(bool) HTMLMinifierOptions HTML5(bool) HTMLMinifierOptions IgnoreCustomComments([]string) HTMLMinifierOptions IgnoreCustomFragments([]string) HTMLMinifierOptions IncludeAutoGeneratedTags(bool) HTMLMinifierOptions KeepClosingSlash(bool) HTMLMinifierOptions MaxLineLength(lineLength uint) HTMLMinifierOptions MinifyCSS(bool) HTMLMinifierOptions MinifyURLs(bool) HTMLMinifierOptions PreserveLineBreaks(bool) HTMLMinifierOptions PreventAttributesEscaping(bool) HTMLMinifierOptions ProcessConditionalComments(bool) HTMLMinifierOptions ProcessScripts([]string) HTMLMinifierOptions QuoteCharacter(character HTMLMinifierQuoteCharacter) HTMLMinifierOptions RemoveAttributeQuotes(bool) HTMLMinifierOptions RemoveComments(bool) HTMLMinifierOptions RemoveEmptyAttributes(bool) HTMLMinifierOptions RemoveEmptyElements(bool) HTMLMinifierOptions RemoveOptionalTags(bool) HTMLMinifierOptions RemoveRedundantAttributes(bool) HTMLMinifierOptions RemoveScriptTypeAttributes(bool) HTMLMinifierOptions RemoveStyleLinkTypeAttributes(bool) HTMLMinifierOptions RemoveTagWhitespace(bool) HTMLMinifierOptions SortAttributes(bool) HTMLMinifierOptions SortClassName(bool) HTMLMinifierOptions TrimCustomFragments(bool) HTMLMinifierOptions UseShortDoctype(bool) HTMLMinifierOptions }
HTMLMinifierOptions is used to construct HTMLMinifier options Detailed explanations of the options are here: https://github.com/kangax/html-minifier#options-quick-reference
func NewHTMLMinifierOptions ¶
func NewHTMLMinifierOptions() HTMLMinifierOptions
type HTMLMinifierQuoteCharacter ¶
type HTMLMinifierQuoteCharacter string
const ( HTMLMinifierSingleQuote HTMLMinifierQuoteCharacter = "'" HTMLMinifierDoubleQuote HTMLMinifierQuoteCharacter = "\"" )
type JuiceOptions ¶
type JuiceOptions interface { ApplyAttributesTableElements(bool) JuiceOptions ApplyHeightAttributes(bool) JuiceOptions ApplyStyleTags(bool) JuiceOptions ApplyWidthAttributes(bool) JuiceOptions ExtraCss(string) JuiceOptions InsertPreservedExtraCss(bool) JuiceOptions InlinePseudoElements(bool) JuiceOptions PreserveFontFaces(bool) JuiceOptions PreserveImportant(bool) JuiceOptions PreserveMediaQueries(bool) JuiceOptions PreserveKeyFrames(bool) JuiceOptions PreservePseudos(bool) JuiceOptions RemoveStyleTags(bool) JuiceOptions XmlMode(bool) JuiceOptions }
JuiceOptions is used to construct Juice options to be passed to the MJML compiler Detailed explanations of the options are here: https://github.com/Automattic/juice#options
func NewJuiceOptions ¶
func NewJuiceOptions() JuiceOptions
type ToHTMLOption ¶
type ToHTMLOption func(options)
ToHTMLOption provides options to customize the compilation process Detailed explanations of each option is available here: https://github.com/mjmlio/mjml#inside-nodejs
func WithBeautify ¶
func WithBeautify(beautify bool) ToHTMLOption
func WithBeautifyOptions ¶
func WithBeautifyOptions(bOptions BeautifyOptions) ToHTMLOption
func WithFonts ¶
func WithFonts(fonts Fonts) ToHTMLOption
func WithJuiceOptions ¶
func WithJuiceOptions(jOptions JuiceOptions) ToHTMLOption
func WithJuicePreserveTags ¶
func WithJuicePreserveTags(preserveTags map[string]JuiceTag) ToHTMLOption
func WithKeepComments ¶
func WithKeepComments(keepComments bool) ToHTMLOption
func WithMinify ¶
func WithMinify(minify bool) ToHTMLOption
func WithMinifyOptions ¶
func WithMinifyOptions(minifyOptions HTMLMinifierOptions) ToHTMLOption
func WithPreprocessors ¶
func WithPreprocessors(preprocessors []string) ToHTMLOption
func WithValidationLevel ¶
func WithValidationLevel(validationLevel ValidationLevel) ToHTMLOption
type ValidationLevel ¶
type ValidationLevel string
const ( Strict ValidationLevel = "strict" Soft ValidationLevel = "soft" Skip ValidationLevel = "skip" )