Skip to content

kaguillera/newspipeline

Repository files navigation

Newsletter Pipepline

This project is about creating a system of producing email newsletters from templates and markdown using the make command. The intention is that it will be as simple as it is to generate a static site like Pelican. It is based on the Foundation for Emails 2 framework but will be optimized for python users (at least this is the intention). The following will most likely be used (the list may most likely change: 71430af3-14f7-496c-ad80-d95829130b2f

  • Github - for the repository
  • Markdown - creating content
  • Python-markdown - used to handle and change the markdown into HTML
  • Make - controls the generation of of the resulting newsletter emails
  • Fabfile - to help with the generation (not necessary)
  • Gulp - Provides the facility to call tasks including but not limited to inline CSS
  • SASS - The CSS generator
  • Python-livereload - Shows the effects of changes on the fly
  • Beautifulsoup or Scrapy - required to extract stuff out of websites
  • Mailchimp or similar - for actually sending out the email
  • Jinja2- the templating framework
  • Foundation For Emails 2 - is the framework that we will use for building responsive emails
  • Image compression - Not sure what tool will be used for this. may come from most likely from F4E 2

Concept/Idea

The overall idea is that we are building a jekell or pelican for email newsletters, You start with a chunk or chunks of markdown, call make you have an email newsletter ready to send out on mailchimp. The newsletter templates are based on Foundation for Emails 2 (F4E 2). Very similar to Pelican the static site generator. This is tricky because of the way email clients work. You have to consider how to handle images etc. The markup for emails is based on tables since the email clients have limited support for modern CSS. F4E 2 helps it is not that user friendly to python users among other things.

Heplful Links

Requirements

Python 2.7 virtualenv

Install Guide

  • Clone repo
    $ git clone https://github.com/kaguillera/newspipeline.git

  • Change directory to project
    $ cd newspipeline

  • Once in directory create a virtualenv using the following command
    $ make env

  • Install requirements using pip
    $ make install

  • Run the porject
    $ make start

As with the original Foundation for email project once it has been successfully installed and run your browser will open with the index page that would have been created in the dist directory.

Other make options

  • Reset project by deleting the env and dist directory
    $ make clean

  • Calls the npm gulp build script
    $ make build

  • As expected does everything. Clean, env, install and start.
    $ make all

Plan of Action

(for my personal use)

  • Produce Template and verify the presentation.
  • Read in the Markdown file and produce HTML snippets
  • Insert the output snippets into the HTML Template newsletter file.
  • Convert the resulting HTML newsletter file into an CSS inline email file
  • Output/write the resulting HTML CSS inline newsletter email file.
Problems/Issues
  • The author may want different parts of the content to go in different places (e.g. make two columns) How do we implement that.
  • It should work if the markdown files are changed or the templates are changed. i.e. ensure decoupling of templates and markdown component.
Ultimately:

We need to take the current F4E add Makefile, remove Panini and Handlebars and replace it with Jinja2, finally replace BrowserSync with Python-livereload. i.e. Pythonize F4E2

Initial Foundation Directory Structure screen shot 2016-04-29 at 11 46 25 am

Estimated Resulting Directory Structure screen shot 2016-04-29 at 11 46 38 am

Progress/TODO

  • Read Pelican Documentation
  • Make a virtualenv for the project
  • Install nodejs (pip install virtual-node)
  • Install foundation-cli using nom (npm install —global foundation-cli)
  • Create a new foundation email project
  • Play around with it by making templates and emails based on the knolly
  • Make it run with make
  • Remove Handlebars bit by bit and replace with Jinja2 bit by bit
  • Create a repo in Github
  • Remove Browersync and replace with python-livereload

About

A Pelican like framework for emails.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published