跳转到主要内容

html5boilerplate的Fanstatic打包

项目描述

js.html5boilerplate

简介

此库为html5boilerplate打包了fanstatic

这需要在您的Web框架和fanstatic之间进行集成,并确保原始资源(在js.html5boilerplate中的resources目录中提供)发布到某个URL。

如何使用?

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

您可以从js.html5boilerplate导入各种文件并在您的页面中need()它们

>>> 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>

如果您需要boilerplate组,还包括了jquery和modernizr

>>> 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>

变更

1.0 (2011-07-08)

  • 初始发布。

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

js.html5boilerplate-1.0.tar.gz (10.4 kB 查看哈希值)

上传时间:

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面