Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
5d04a05
Update componentFactory.js
tazzydemon Feb 8, 2017
6b78100
Merge pull request #78 from tazzydemon/master
tdhartwick Apr 19, 2017
951ca72
Target gulpjs release instead of deleted branch
Nov 2, 2018
57dd724
Fix test by inlining anchor tag like the rest of the tests
Nov 3, 2018
88cc5f6
Fix spacer component on Outlook and Windows Mail clients (fixes #104)
Nov 3, 2018
fd44b53
Merge pull request #106 from DylanReile/develop
rafibomb Mar 27, 2020
eee5445
update package
joeworkman Jul 20, 2020
151e8e7
upgrade vinyul
joeworkman Jul 20, 2020
f551b5a
updated mocha
joeworkman Jul 20, 2020
dfd77d5
Merge branch 'feature/dependency-update' into develop
joeworkman Jul 20, 2020
f8c53cf
updated branding and urls in readme
joeworkman Jul 21, 2020
7a250e1
Merge branch 'master' into develop
joeworkman Jul 21, 2020
49b87a0
Fixed grid tests
joeworkman Jul 21, 2020
54a9c7a
Merge tag 'v1.4.0' into develop
joeworkman Jul 21, 2020
c13e215
Merge branch 'release/v1.4.0'
joeworkman Jul 21, 2020
e96726c
rebuild dist
joeworkman Jul 21, 2020
afcfda9
uptick version number
joeworkman Jul 21, 2020
25342d6
Merge branch 'release/v1.4.1'
joeworkman Jul 21, 2020
2ca268f
Merge tag 'v1.4.1' into develop
joeworkman Jul 21, 2020
925cbee
Revert "Update componentFactory.js"
DanielRuf Jul 24, 2020
6d72167
Merge branch 'develop'
DanielRuf Jul 24, 2020
b0499f7
Revert "Fixed grid tests"
joeworkman Jul 29, 2020
eb98652
1.4.2 version bump
joeworkman Jul 29, 2020
409ba41
Merge branch 'release/v1.4.2' into master
joeworkman Jul 29, 2020
853532a
Merge tag 'v1.4.2' into develop
joeworkman Jul 29, 2020
87069be
Run tests on Node 10, 12 and latest
DanielRuf Aug 2, 2020
f76f479
Update Travis CI link
DanielRuf Aug 2, 2020
a37055f
Fix title and anchor
DanielRuf Sep 10, 2020
d8a6785
Bump ini from 1.3.5 to 1.3.8
dependabot[bot] Dec 13, 2020
85ef7c9
Bump y18n from 3.2.1 to 3.2.2
dependabot[bot] Apr 1, 2021
7d39fbd
Bump lodash from 4.17.19 to 4.17.21
dependabot[bot] May 11, 2021
b247796
Bump hosted-git-info from 2.8.8 to 2.8.9
dependabot[bot] May 11, 2021
c5dedda
Bump path-parse from 1.0.6 to 1.0.7
dependabot[bot] Aug 12, 2021
de28dbb
Merge pull request #125 from foundation/dependabot/npm_and_yarn/ini-1…
joeworkman Oct 26, 2021
2425ee7
Merge pull request #128 from foundation/dependabot/npm_and_yarn/y18n-…
joeworkman Oct 26, 2021
32f5739
Merge pull request #130 from foundation/dependabot/npm_and_yarn/lodas…
joeworkman Oct 26, 2021
4a7140a
Merge pull request #131 from foundation/dependabot/npm_and_yarn/hoste…
joeworkman Oct 26, 2021
4e2bdf0
Bump elliptic from 6.5.3 to 6.5.4
dependabot[bot] Oct 26, 2021
4b20143
Merge pull request #132 from foundation/dependabot/npm_and_yarn/path-…
joeworkman Oct 26, 2021
3ee0019
Bump bl from 1.2.2 to 1.2.3
dependabot[bot] Oct 26, 2021
ff6eb36
Merge pull request #133 from foundation/dependabot/npm_and_yarn/ellip…
joeworkman Oct 26, 2021
8e471ed
Merge pull request #134 from foundation/dependabot/npm_and_yarn/bl-1.2.3
joeworkman Oct 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js:
- "0.12"
- "4.4"
- "5.9"
- "10"
- "12"
- "node"
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Inky

[![Build Status](https://travis-ci.org/zurb/inky.svg?branch=master)](https://travis-ci.org/zurb/inky) [![npm version](https://badge.fury.io/js/inky.svg)](https://badge.fury.io/js/inky)
[![Build Status](https://travis-ci.com/foundation/inky.svg?branch=master)](https://travis-ci.com/foundation/inky) [![npm version](https://badge.fury.io/js/inky.svg)](https://badge.fury.io/js/inky)

Inky is an HTML-based templating language that converts simple HTML into complex, responsive email-ready HTML. Designed for [Foundation for Emails](http://foundation.zurb.com/emails), a responsive email framework from [ZURB](http://zurb.com).
Inky is an HTML-based templating language that converts simple HTML into complex, responsive email-ready HTML. Designed for [Foundation for Emails](https://get.foundation/emails).

Give Inky simple HTML like this:

Expand Down Expand Up @@ -75,14 +75,7 @@ function parse() {

### Command Line

Install [inky-cli](https://github.com/zurb/inky-cli) to get the `inky` command. The first option is a glob of input files, and the second option is a folder to output them to. Add the `--watch` flag to re-compile when files are added or changed.

```bash
npm install inky-cli --global
inky src/pages/**/*.html dist --watch
```

Doesn't support advanced settings at the moment.
Install [foundation-cli](https://github.com/foundation/foundation-cli) to get the `foundation` command.

## Plugin Settings

Expand All @@ -92,7 +85,7 @@ Doesn't support advanced settings at the moment.
- `columnCount` (Number): Column count for the grid. Make sure your Foundation for Emails project has the same column count in the Sass as well.
- `cheerio` (Object): cheerio settings (for available options please refer to [cheerio project at github](https://github.com/cheeriojs/cheerio)).

## Custom Elements
## Custom Components

Inky simplifies the process of creating HTML emails by expanding out simple tags like `<row>` and `<column>` into full table syntax. The names of the tags can be changed with the `components` setting.

Expand Down
17 changes: 9 additions & 8 deletions dist/inky-browser.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions lib/componentFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ module.exports = function(element) {
if (element.attr('size-sm') || element.attr('size-lg')) {
if (element.attr('size-sm')) {
size = (element.attr('size-sm'));
html += format('<table %s class="%s hide-for-large"><tbody><tr><td height="'+size+'px" style="font-size:'+size+'px;line-height:'+size+'px;">&nbsp;</td></tr></tbody></table>', attrs);
html += format('<table %s class="%s hide-for-large"><tbody><tr><td height="'+size+'" style="font-size:'+size+'px;line-height:'+size+'px;">&nbsp;</td></tr></tbody></table>', attrs);
}
if (element.attr('size-lg')) {
size = (element.attr('size-lg'));
html += format('<table %s class="%s show-for-large"><tbody><tr><td height="'+size+'px" style="font-size:'+size+'px;line-height:'+size+'px;">&nbsp;</td></tr></tbody></table>', attrs);
html += format('<table %s class="%s show-for-large"><tbody><tr><td height="'+size+'" style="font-size:'+size+'px;line-height:'+size+'px;">&nbsp;</td></tr></tbody></table>', attrs);
}
} else {
size = (element.attr('size')) || 16;
html += format('<table %s class="%s"><tbody><tr><td height="'+size+'px" style="font-size:'+size+'px;line-height:'+size+'px;">&nbsp;</td></tr></tbody></table>', attrs);
html += format('<table %s class="%s"><tbody><tr><td height="'+size+'" style="font-size:'+size+'px;line-height:'+size+'px;">&nbsp;</td></tr></tbody></table>', attrs);
}

if( element.attr('size-sm') && element.attr('size-lg') ) {
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "inky",
"version": "1.3.7",
"version": "1.4.2",
"description": "Convert a simple HTML syntax into tables compatible with Foundation for Emails.",
"author": "ZURB <foundation@zurb.com> (http://foundation.zurb.com)",
"author": "Foundation <contact@get.foundation> (https://get.foundation)",
"keywords": [
"ink",
"foundation",
Expand All @@ -11,7 +11,7 @@
],
"main": "index.js",
"scripts": {
"test": "mocha --compilers js:babel-register",
"test": "mocha --require babel-core/register",
"browser": "gulp browser"
},
"dependencies": {
Expand All @@ -20,22 +20,22 @@
"mkdirp": "^0.5.1",
"object-values": "^1.0.0",
"through2": "^2.0.0",
"vinyl-fs": "^2.3.0"
"vinyl-fs": "^3.0.3"
},
"devDependencies": {
"assert-html-equal": "^1.0.0",
"babel-preset-es2015": "^6.3.13",
"babel-register": "^6.4.3",
"browserify": "^13.1.0",
"chalk": "^1.1.1",
"gulp": "git+https://github.com/gulpjs/gulp.git#4.0",
"gulp": "4.0",
"gulp-uglify": "^2.0.0",
"mocha": "^2.4.5",
"mocha": "^8.0.1",
"rimraf": "^2.5.1",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0"
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0"
},
"repository": "https://github.com/zurb/inky.git",
"bugs": "https://github.com/zurb/inky/issues",
"repository": "https://github.com/foundation/inky.git",
"bugs": "https://github.com/foundation/inky/issues",
"license": "MIT"
}
20 changes: 9 additions & 11 deletions test/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ describe('Center', () => {
<table>
<tbody>
<tr>
<th class="menu-item float-center">
<a href="#"></a>
</th>
<th class="menu-item float-center"><a href="#"></a></th>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -319,7 +317,7 @@ describe('Spacer', () => {
<table class="spacer">
<tbody>
<tr>
<td height="10px" style="font-size:10px;line-height:10px;">&nbsp;</td>
<td height="10" style="font-size:10px;line-height:10px;">&nbsp;</td>
</tr>
</tbody>
</table>
Expand All @@ -335,7 +333,7 @@ describe('Spacer', () => {
<table class="spacer">
<tbody>
<tr>
<td height="16px" style="font-size:16px;line-height:16px;">&nbsp;</td>
<td height="16" style="font-size:16px;line-height:16px;">&nbsp;</td>
</tr>
</tbody>
</table>
Expand All @@ -350,7 +348,7 @@ describe('Spacer', () => {
<table class="spacer hide-for-large">
<tbody>
<tr>
<td height="10px" style="font-size:10px;line-height:10px;">&nbsp;</td>
<td height="10" style="font-size:10px;line-height:10px;">&nbsp;</td>
</tr>
</tbody>
</table>
Expand All @@ -365,7 +363,7 @@ describe('Spacer', () => {
<table class="spacer show-for-large">
<tbody>
<tr>
<td height="20px" style="font-size:20px;line-height:20px;">&nbsp;</td>
<td height="20" style="font-size:20px;line-height:20px;">&nbsp;</td>
</tr>
</tbody>
</table>
Expand All @@ -380,14 +378,14 @@ describe('Spacer', () => {
<table class="spacer hide-for-large">
<tbody>
<tr>
<td height="10px" style="font-size:10px;line-height:10px;">&nbsp;</td>
<td height="10" style="font-size:10px;line-height:10px;">&nbsp;</td>
</tr>
</tbody>
</table>
<table class="spacer show-for-large">
<tbody>
<tr>
<td height="20px" style="font-size:20px;line-height:20px;">&nbsp;</td>
<td height="20" style="font-size:20px;line-height:20px;">&nbsp;</td>
</tr>
</tbody>
</table>
Expand All @@ -402,7 +400,7 @@ describe('Spacer', () => {
<table class="spacer bgcolor">
<tbody>
<tr>
<td height="10px" style="font-size:10px;line-height:10px;">&nbsp;</td>
<td height="10" style="font-size:10px;line-height:10px;">&nbsp;</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -442,7 +440,7 @@ describe('h-line', () => {
compare(input, expected);
});
});

describe('raw', () => {
it('creates a wrapper that ignores anything inside', () => {
var input = `<raw><<LCG Program\TG LCG Coupon Code Default='246996'>></raw>`;
Expand Down
Loading