{ "info": { "author": "Matt Good", "author_email": "matt@matt-good.net", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Flask-Fanstatic\n===============\n\nFlask integration for the Fanstatic resource publishing system.\n\nhttp://www.fanstatic.org/\n\n.. image:: https://api.travis-ci.org/mgood/flask-fanstatic.png\n :target: https://travis-ci.org/mgood/flask-fanstatic\n\n\nOverview\n--------\n\nFanstatic is a flexible system for managing the static resources (CSS and\nJavascript) used by your web application. This extension provides simple\nintegration between Fanstatic and Flask.\n\nAdding static resources to your application becomes as simple as installing them\nwith pip::\n\n pip install js.jquery\n\nand ``need``-ing them in your template::\n\n {{ g.fanstatic.needs('js.jquery:jquery') }}\n\n\nUsage\n-----\n\nTo start using Flask-Fanstatic, import and initialize the extension for your\nFlask application::\n\n from flask import Flask\n from flask_fanstatic import Fanstatic\n\n app = Flask(__name__)\n fanstatic = Fanstatic(app)\n\nThen, in your base template, add the ``top`` and ``bottom`` resources to include\nthem in your HTML::\n\n
\n {{ g.fanstatic.top }}\n \n\n \n ...content...\n\n {{ g.fanstatic.bottom }}\n \n\nYou can declare resource to include, by using the ``needs()`` helper to declare\nresources needed by your template::\n\n {{- g.fanstatic.needs('js.jquery:jquery') -}}\n {% extends 'layout.html' %}\n ...\n\n.. note:: The example above uses dashes to tell Jinja to strip the extra whitespace such\n as the newline after the expression. See the Jinja docs for more details:\n http://jinja.pocoo.org/docs/templates/#whitespace-control\n\nFanstatic will use the ``top`` and ``bottom`` helpers above to include the CSS\nor JavaScript resources ``need``-ed automatically.\n\nYou can also ``need`` multiple resources::\n\n {{ g.fanstatic.needs(\n 'js.jquery:jquery',\n 'js.handlebars:handlebars'\n ) }}\n\nThe ``needs()`` method takes any number of strings, in the form\n``