Bootstrap helper for Flask/Jinja2.
Project description
Bootstrap-Flask
Bootstrap helper for Flask/Jinja2. Based on Flask-Bootstrap, but lighter and better.
Installation
$ pip install bootstrap-flask
Initialization
from flask_bootstrap import Bootstrap
from flask import Flask
app = Flask(__name__)
bootstrap = Bootstrap(app)
Resources helpers
When development, Bootstrap-Flask provides two helper functions that can be used to generate
resources load code in template: bootstrap.load_css()
and bootstrap.load_js()
Call it at your template, for example:
<head>
{{ bootstrap.load_css() }}
</head>
<body>
...
{{ bootstrap.load_js() }}
</body>
Macros
Macro | Templates Path | Description |
---|---|---|
render_field() | bootstrap/form.html | Redner a WTForms form field |
render_form() | bootstrap/form.html | Render a WTForms form |
render_pager() | bootstrap/pagination.html | Render a basic pagination, only include previous and next button. |
render_pagination() | bootstrap/pagination.html | Render a standard pagination |
render_nav_item() | bootstrap/nav.html | Render a navigation item |
render_breadcrumb_item() | bootstrap/nav.html | Render a breadcrumb item |
render_static() | bootstrap/utils.html | Render a resource reference code (i.e. <link> , <script> ) |
How to use these macors? It's quite simple, just import them from the correspond path and then call them like any other macro:
from 'bootstrap/form.html' import render_form
{{ render_form(form) }}
API documentation will coming soon...
Changelog
1.0
Release date: 2018/6/11
Initialize release.
License
This project is licensed under the MIT License (see the
LICENSE
file for details).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file Bootstrap-Flask-1.0.tar.gz
.
File metadata
- Download URL: Bootstrap-Flask-1.0.tar.gz
- Upload date:
- Size: 745.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09ae6384193627cbb69f76c8965ac2c670e6033563316d11b6b93da087e91931 |
|
MD5 | 1c311d8647c27641270bd600ef0d993b |
|
BLAKE2b-256 | befe7c3e49ba9d87e8ed9b6f22d7498002ae0d1cb34fe8450c7fcf2352c7744d |
File details
Details for the file Bootstrap_Flask-1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: Bootstrap_Flask-1.0-py2.py3-none-any.whl
- Upload date:
- Size: 762.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36d1984af210ae8419f5e2f477ecdd3a7226c54679be8614d4d1be49c16ba94a |
|
MD5 | 3dcc70f481f12a8bc15badd004edadbe |
|
BLAKE2b-256 | 2a4c2a2aa8534d2271d2423a0da1d6ad14ce2f1267fef5a07ea1c59cd650f8e2 |