package
module
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: Apr 7, 2024
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
mjml2html
Usage
package main
import "github.com/TcMits/mjml2html"
func main() {
html, err := mjml2html.ToHTML(`<mjml>
<mj-body>
<mj-section>
<mj-column>
<mj-image width="100px" src="/assets/img/logo-small.png"></mj-image>
<mj-divider border-color="#F45E43"></mj-divider>
<mj-text font-size="20px" color="#F45E43" font-family="helvetica">{{ if eq 1 2 }}3{{ end }}</mj-text>
<mj-text font-size="20px" color="#F45E43" font-family="helvetica">Hello World</mj-text>
</mj-column>
</mj-section>
</mj-body>
</mjml>`)
if err != nil {
panic(err)
}
println(html)
}
Documentation
¶
func KeepComments(b bool) option
func ValidationLevel(l string) option
type MJMLNode struct {
TagName string `json:"tagName"`
Attributes map[string]string `json:"attributes"`
Content string `json:"content,omitempty"`
Children []MJMLNode `json:"children,omitempty"`
}
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.