https://github.com/foundation/foundation-web-inliner
Web inliner for get.foundation.com.
https://github.com/foundation/foundation-web-inliner
Last synced: 10 months ago
JSON representation
Web inliner for get.foundation.com.
- Host: GitHub
- URL: https://github.com/foundation/foundation-web-inliner
- Owner: foundation
- Created: 2016-03-04T00:49:44.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-11-07T20:42:22.000Z (over 3 years ago)
- Last Synced: 2025-04-28T07:40:11.852Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 17.6 KB
- Stars: 2
- Watchers: 10
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Web Inliner
This is the [web inliner](http://foundation.zurb.com/emails/inliner.html) used on the Foundation for Emails marketing site. The files generated here are copied to the Foundation marketing site codebase.
## API
`index.js` has DOM-specific functions that leverage the web inliner's guts. It should be Browserified to run in the browser. `lib/inline.js` is the inliner itself, and can be run in Node.
### inline(html, css, options)
Inline the contents of `html`, along with any code inside `css`.
#### html
**Type:** `String`
HTML to inline.
#### css
**Type:** `String`
CSS to inline into HTML.
#### options
**Type:** `Object`
- `compress` (`Boolean`): Compress final HTML output.
- `onSuccess` (`Function`): Callback to run when inlining is done. Includes an `html` parameter with the output.
- `onError` (`Function`): Callback to run if there's an error. Includes an `err` parameter with the error.
## Development
```bash
git clone https://github.com/zurb/web-inliner
cd web-inliner
npm install
```
Run `npm start` to start the build process. A new JavaScript bundle will be generated each time you save `index.js`.
Run `npm run build` to generate a compressed bundle. Use this compressed file on the Foundation marketing site.