SkillAgentSearch skills...

M.py

Takes an HTML document, minifies and inlines all CSS and JS. Includes WSGI middleware for platforms like Google AppEngine, and optional memcached caching.

Install / Use

/learn @nate-parrott/M.py
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

m.py

Takes an HTML document, minifies and inlines all CSS and JS. Includes WSGI middleware for platforms like Google AppEngine, and optional memcached caching.

Installation

Add m.py to your project, as well as all the dependencies;

  • cssutils
  • htmlmin
  • slimit (JS minifier)
  • BeautifulSoup4

Usage

from m import minify
minified_html = minify(html)

On AppEngine:

Replace:

app = webapp2.WSGIApplication([
    ('/', MainHandler),
])

with:

app = webapp2.WSGIApplication([
    ('/', MainHandler),
])
import m
app = m.WSGIMiddleware(app, memcache=memcache)

Related Skills

View on GitHub
GitHub Stars15
CategoryDevelopment
Updated3y ago
Forks0

Languages

Python

Security Score

75/100

Audited on Jul 27, 2022

No findings