https://github.com/onel/pinky
A python port of Zurb's Inky email Html template system
https://github.com/onel/pinky
email-template html
Last synced: over 1 year ago
JSON representation
A python port of Zurb's Inky email Html template system
- Host: GitHub
- URL: https://github.com/onel/pinky
- Owner: onel
- License: mit
- Created: 2018-04-23T19:19:44.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-30T11:00:50.000Z (about 8 years ago)
- Last Synced: 2025-01-26T08:11:44.727Z (over 1 year ago)
- Topics: email-template, html
- Language: Python
- Homepage: https://github.com/zurb/inky
- Size: 6.84 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pinky
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 built for node, Pinky is just a python port for this great library.**
Give Inky simple HTML like this:
```html
```
And get complicated, but battle-tested, email-ready HTML like this:
```html
```
## Installation
Git clone this repo and then install with pip locally
```bash
git clone https://github.com/onel/pinky.git
pip install ./pinky
```
**COMING SOON: pip package**
## Usage
Pinky can be used programatically or from the command line
### Programmatic Use
```py
from pinky import Pinky
html_string = '...'
result = Pinky.parse(html_string)
```
### Command Line
```bash
pinky "[html string]"
```
The command returns the resulted HTML string.
## Under the hood
Pinky uses [BeautifulSoop4](https://pypi.org/project/beautifulsoup4/) (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](https://github.com/peterbe/premailer) to inline the CSS and minify the HTML.