skate

command module
v0.0.0-...-cdd24ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2020 License: MIT Imports: 8 Imported by: 0

README

Skate

Command line utility to use Zurb's Ink Inliner (http://zurb.com/ink/inliner.php) for HTML emails.

Usage

Given you have an html file:

<html>
  <head>
    <style>
      body{
        margin:20px;
      }
    </style>
  </head>
  <body></body>
</html>

Just pass a html file path as argument to Skate:

› skate index.html

And you'll get an inlined version:

<!-- Inliner Build Version 4380b7741bb759d6cb997545f3add21ad48f010b -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head></head>
<body style="margin: 20px;"></body>
</html>

Skate tries to be a good Unix citizen. That means that you can use stdin and stdout to pipe in/out data with the Inliner:

› date | skate
<!-- Inliner Build Version 4380b7741bb759d6cb997545f3add21ad48f010b -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p>martes, 25 de marzo de 2014, 13:44:41 GMT
</p></body></html>

Or in a more realistic example:

› skate index.html > inlined.html
Why inline styles?

Inline styles is a good technique to achieve consistent rendering when sending email newsletters to difference email client. As mentioned by Zurb's guys:

  • Popular email clients like Gmail strip out CSS in the <style> tag.
  • This is the best way to guarantee your email works properly on the compatible clients listed in the docs.
Disclaimer

This is literally my first piece of code in Go. Please, be understanding.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL