Inky is an HTML-based templating language that converts simple HTML into complex, responsive email-ready HTML. Designed for Foundation for Emails, a responsive email framework from ZURB.
Inky is built for node, Pinky is just a python port for this great library.
Give Inky simple HTML like this:
<row>
<columns large="6"></columns>
<columns large="6"></columns>
</row>
And get complicated, but battle-tested, email-ready HTML like this:
<table class="row">
<tbody>
<tr>
<th class="small-12 large-6 columns first">
<table>
<tr>
<th class="expander"></th>
</tr>
</table>
</th>
<th class="small-12 large-6 columns first">
<table>
<tr>
<th class="expander"></th>
</tr>
</table>
</th>
</tr>
</tbody>
</table>
Git clone this repo and then install with pip locally
git clone https://github.com/onel/pinky.git
pip install ./pinky
COMING SOON: pip package
Pinky can be used programatically or from the command line
from pinky import Pinky
html_string = '<html>...</html>'
result = Pinky.parse(html_string)
pinky "[html string]"
The command returns the resulted HTML string.
Pinky uses BeautifulSoop4 (with the lxml option) to parse the received html string and then replace all the custom Inky tags with the proper html elements (table, tr, td, etc.).
In the second step is uses Premailer to inline the CSS and minify the HTML.