@lit-pigeon/renderer-mjml
v0.2.5
Published
MJML-based HTML renderer for Pigeon email editor
Maintainers
Readme
@lit-pigeon/renderer-mjml
MJML-based HTML renderer for Lit Pigeon.
Converts a PigeonDocument into a full MJML markup string, then compiles it to
email-client-safe, inlined-CSS, table-based HTML (with optional Outlook
mso/VML workarounds).
Install
npm install @lit-pigeon/renderer-mjmlBundles mjml as a dependency.
Usage
import { MjmlRenderer } from '@lit-pigeon/renderer-mjml';
import { createDefaultDocument } from '@lit-pigeon/core';
const renderer = new MjmlRenderer();
const doc = createDefaultDocument();
const { html, errors } = await renderer.render(doc, {
outlookWorkarounds: true, // default
minify: false,
});
// `html` is ready to send; `errors` is empty on success.MjmlRenderer implements the core Renderer interface, so it can be passed
straight to the editor's preview/export path or the framework wrappers. Need
just the MJML markup (no HTML compile)? Use documentToMjml(doc, options).
For a DOM-free server pipeline (parse + validate + merge tags), see
@lit-pigeon/ssr.
Part of Lit Pigeon — open-source drag-and-drop email editor.
License
MIT
