Skip to main content

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.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

js.html5boilerplate-1.0.tar.gz (10.4 kB view details)

Uploaded Source

File details

Details for the file js.html5boilerplate-1.0.tar.gz.

File metadata

File hashes

Hashes for js.html5boilerplate-1.0.tar.gz
Algorithm Hash digest
SHA256 f36891ff755b62eaf89685a1d274c9a03b7acf4b140fd595cfa60b491387b01d
MD5 23a5571cd5b48c1d5decbf4003b0dcbf
BLAKE2b-256 2a235280d650f47f0ba3e9754f96e467e711715a3673ac3d62c46fbae5f0cdb1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page