forked from homerjam/mjml-mailchimp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.js
38 lines (34 loc) · 940 Bytes
/
cli.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const fs = require('fs')
const mjml2html = require('mjml')
const { registerComponent } = require('mjml-core')
const { registerDependencies } = require('mjml-validator')
const {
MpSection,
MpImage,
MpText,
MpButton,
MpColumn,
MpSocialElement,
} = require('./index.js')
registerComponent(MpSection)
registerComponent(MpImage)
registerComponent(MpText)
registerComponent(MpButton)
registerComponent(MpColumn)
registerComponent(MpSocialElement)
// registerDependencies({
// 'mp-section': ['mj-column', 'mj-group', 'mj-raw'],
// 'mj-column': ['mp-image', 'mp-text', 'mp-button'],
// 'mj-hero': ['mp-image'],
// 'mp-button': [],
// 'mp-text': [],
// 'mp-column': [],
// });
// const file = fs.readFileSync(process.argv[2])
// const mjmlContent = mjml2html(file.toString())
// if (mjmlContent.errors.length > 0) {
// console.log(mjmlContent)
// } else {
// console.log(mjmlContent.html)
// }
require('mjml-cli')