{ "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``:``. You can alternatively import the resources from your\ncode and require them like::\n\n from js.jquery import jquery\n\n @app.route('/')\n def index():\n jquery.need()\n return render_template('index.html')\n\n\nApplication resources\n---------------------\n\nFlask-Fanstatic also makes it easy to add your application's own static files as\nFanstatic resources.\n\nYou can use the ``resource()`` helper to declare a resource in your\napplication's ``'static'`` folder::\n\n fanstatic.resource('js/app.js', name='app_js', depends=[jquery])\n\nTo include the resource, just use its ``name`` to require it in your template::\n\n {{ g.fanstatic.needs('app_js') }}\n\nYou can also declare named groups of resources::\n\n from js.jquery import jquery\n fanstatic.resource('css/app.js', name='app_js')\n\n # there are 3 ways to specify a group resource item:\n fanstatic.group('app_resources', [\n # with an imported resource:\n jquery,\n\n # with the name of an internal resource:\n 'app_js',\n\n # with an inline resource:\n fanstatic.resource('css/app.css'),\n ])\n\nGroups are included in the same way from the template::\n\n {{ g.fanstatic.needs('app_resources') }}\n\n\nBlueprint resources\n-------------------\n\nBlueprints can also use Fanstatic in almost the same way as application\nresources. Start by initializing a ``Fanstatic()`` object for your blueprint,\nand declare its resources::\n\n bluep = Blueprint('bluep', __name__, static_folder='static')\n fanstatic = Fanstatic(bluep)\n fanstatic.resource('bluep.css', name='bluep_css')\n\nIn the template, reference resources from the current blueprint as ``.``::\n\n {{ g.fanstatic.needs('.bluep_css') }}\n\nOr explicitly provide the name of a blueprint to include a resource from a\nspecific blueprint::\n\n {{ g.fanstatic.needs('bluep.bluep_css') }}\n\n\nChanges\n=======\n\n0.2.0 (2014-01-04)\n------------------\n\nSupport for Fanstatic 1.0\n\n\n0.1.1 (2013-05-08)\n------------------\n\n* fix for apps with a url prefix\n\n\n0.1.0 (2012-11-19)\n------------------\n\nInitial release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/mgood/flask-fanstatic", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "Flask-Fanstatic", "package_url": "https://pypi.org/project/Flask-Fanstatic/", "platform": "any", "project_url": "https://pypi.org/project/Flask-Fanstatic/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/mgood/flask-fanstatic" }, "release_url": "https://pypi.org/project/Flask-Fanstatic/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "Flask integration for the Fanstatic resource publishing system.", "version": "0.2.0" }, "last_serial": 960757, "releases": { "0.1": [], "0.1.0": [ { "comment_text": "", "digests": { "md5": "6447964ea6c04ec781e39864f830b775", "sha256": "1ef7375a52e9fa635f03c9e07ac67c6748282480cb44eab22a2eb4eb5b819b2f" }, "downloads": -1, "filename": "Flask-Fanstatic-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6447964ea6c04ec781e39864f830b775", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4638, "upload_time": "2012-11-19T22:36:17", "url": "https://files.pythonhosted.org/packages/27/0e/ef496afd5fe096c9258e12869e29197396ac46396cc94ee383d6ec7fe377/Flask-Fanstatic-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6085d0ffc11e90b19e83fdaffa0a1335", "sha256": "7f577451e1ca6c05d2769bedf1b2011c99ced022793a1692dbdc98501cc9aa64" }, "downloads": -1, "filename": "Flask-Fanstatic-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6085d0ffc11e90b19e83fdaffa0a1335", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6466, "upload_time": "2013-05-08T20:29:18", "url": "https://files.pythonhosted.org/packages/51/b9/4d9c45fb175a5add233a309d334d90c106551db563189655f9eee992c0f6/Flask-Fanstatic-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "24682497166583abf1cc53b6ef13be24", "sha256": "e819a2013e4c3a398ba1dd76670d9e83d35b7f2aa67539c5928fc49f5c69b4f3" }, "downloads": -1, "filename": "Flask-Fanstatic-0.2.0.tar.gz", "has_sig": false, "md5_digest": "24682497166583abf1cc53b6ef13be24", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5169, "upload_time": "2014-01-04T22:54:49", "url": "https://files.pythonhosted.org/packages/17/f2/24826869906c38d751de616c983ccfab96472d4f39d302c3dff7fc7133ed/Flask-Fanstatic-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "24682497166583abf1cc53b6ef13be24", "sha256": "e819a2013e4c3a398ba1dd76670d9e83d35b7f2aa67539c5928fc49f5c69b4f3" }, "downloads": -1, "filename": "Flask-Fanstatic-0.2.0.tar.gz", "has_sig": false, "md5_digest": "24682497166583abf1cc53b6ef13be24", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5169, "upload_time": "2014-01-04T22:54:49", "url": "https://files.pythonhosted.org/packages/17/f2/24826869906c38d751de616c983ccfab96472d4f39d302c3dff7fc7133ed/Flask-Fanstatic-0.2.0.tar.gz" } ] }