Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pyx/flask-pure

Flask-Pure - a Flask extension for Pure.css
https://github.com/pyx/flask-pure

flask flask-extensions purecss

Last synced: about 1 month ago
JSON representation

Flask-Pure - a Flask extension for Pure.css

Awesome Lists containing this project

README

        

===========================================
Flask-Pure - a Flask extension for Pure.css
===========================================

Flask-Pure is an extension to `Flask`_ that helps integrate `Pure.css`_ to your
Flask application.

.. _Flask: http://flask.pocoo.org/
.. _Pure.css: http://purecss.io/

Quick Start
===========

0. Installation

.. code-block:: sh

pip install Flask-Pure

1. Configuration

.. code-block:: python

from flask import Flask, render_template
from flask_pure import Pure

app = Flask(__name__)
app.config['PURECSS_RESPONSIVE_GRIDS'] = True
app.config['PURECSS_USE_CDN'] = True
app.config['PURECSS_USE_MINIFIED'] = True
Pure(app)

@app.route('/')
def hello():
return render_template('hello.html')

if __name__ == '__main__':
app.run(debug=True)

2. In :code:`templates/hello.html`:

.. code-block:: jinja

{% extends "pure/layout.html" %}
{% block title %}Hello world from flask-pure{% endblock %}

{% block nav %}




{% endblock %}

{% block content %}

Hello world


{% endblock %}

3. Profit!

How It Works
============

Once registered, this extension provides a template variable called
:code:`pure`, it has a property named :code:`css` that will be rendered
as HTML :code:`` tag to the Pure.css stylesheets either from free CDN or
be served from a bundled blueprint, also called :code:`pure`.

A :code:`{{ pure.css }}` inside :code:`` tag is all you need.

A bare bone HTML5 template is also available as :code:`pure/layout.html`.
Please check out the example in code repository and documentation for details.

License
=======

BSD New, see LICENSE for details.

Links
=====

- `Documentation `_

- `Issue Tracker `_

- `Source Package @ PyPI `_

- `Mercurial Repository @ bitbucket
`_

- `Git Repository @ Github
`_

- `Git Repository @ Gitlab
`_

- `Development Version
`_