{ "info": { "author": "Peter Bengtsson", "author_email": "mail@peterbe.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Other Environment", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: Python Software Foundation License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Communications", "Topic :: Internet :: WWW/HTTP", "Topic :: Other/Nonlisted Topic", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "premailer\n=========\n\n\nTurns CSS blocks into style attributes\n--------------------------------------\n\nWhen you send HTML emails you can't used style tags but instead you\nhave to put inline `style` attributes on every element. So from this::\n\n \n \n
Hej
\n \n\nYou want this::\n\n \nHej
\n \n\n\npremailer does this. It parses an HTML page, looks up `style` blocks\nand parses the CSS. It then uses the `lxml.html` parser to modify the\nDOM tree of the page accordingly.\n\nGetting started\n---------------\n\nIf you havena't already done so, install `premailer` first::\n\n $ pip install premailer\n\nNext, the most basic use is to use the shortcut function, like this::\n\n >>> from premailer import transform\n >>> print transform(\"\"\"\n ... \n ... \n ...Hej
\n ... \n ... \"\"\")\n \n \n \nHej
\n \n \n\nFor more advanced options, check out the code of the `Premailer` class\nand all its options in its constructor.\n\n\nTurning relative URLs into absolute URLs\n----------------------------------------\n\nAnother thing premailer can do for you is to turn relative URLs (e.g.\n\"/some/page.html\" into \"http://www.peterbe.com/some/page.html\"). It\ndoes this to all `href` and `src` attributes that don't have a `://`\npart in it. For example, turning this::\n\n \n \n Home\n Page\n External\n