Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Fanstatic packaging of html5boilerplate

Project Description

js.html5boilerplate

Introduction

This library packages html5boilerplate for fanstatic.

This requires integration between your web framework and fanstatic, and making sure that the original resources (shipped in the resources directory in js.html5boilerplate) are published to some URL.

How to use?

>>> from fanstatic import NeededResources
>>> needed = NeededResources(bottom=True)

You can import the various files from js.html5boilerplate and need() them in your page:

>>> from js.html5boilerplate import style, pngfix
>>> needed.need(style)
>>> needed.need(pngfix)

>>> html = '''
... <!doctype html>
... <html>
...   <head>
...   </head>
...   <body>
...     my content
...   </body>
... </html>'''
>>> print needed.render_topbottom_into_html(html)
<BLANKLINE>
<!doctype html>
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="/fanstatic/html5boilerplate/css/style.css" />
<BLANKLINE>
  </head>
  <body>
    my content
  <!--[if lt IE 7 ]>
    <script src="/fanstatic/html5boilerplate/js/dd_belatedpng.js"></script>
    <script>DD_belatedPNG.fix("img, .png_bg");
  <![endif]--></body>
</html>

If you need the boilerplate group, jquery and modernizr are also included:

>>> from js.html5boilerplate import boilerplate
>>> needed = NeededResources(resources=[boilerplate], bottom=True)
>>> print needed.render_topbottom_into_html(html)
<BLANKLINE>
<!doctype html>
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="/fanstatic/html5boilerplate/css/style.css" />
<script type="text/javascript" src="/fanstatic/jquery/jquery.js"></script>
<script type="text/javascript" src="/fanstatic/modernizr/modernizr.js"></script>
<BLANKLINE>
  </head>
  <body>
    my content
  <!--[if lt IE 7 ]>
    <script src="/fanstatic/html5boilerplate/js/dd_belatedpng.js"></script>
    <script>DD_belatedPNG.fix("img, .png_bg");
  <![endif]--></body>
</html>

CHANGES

1.0 (2011-07-08)

  • Initial release.
Release History

Release History

This version
History Node

1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
js.html5boilerplate-1.0.tar.gz (10.4 kB) Copy SHA256 Checksum SHA256 Source Jul 8, 2011

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting