Growler - Jade
A Growler render engine for processing jade template files. This uses the pyjade package with the mako base - though this should be strictly an implemenation detail and not a concern of the user.
Installation
To install the latest stable (published) version, use the pypi repository
pip install growler-jade
To use the (semi-stable) development branch, you can use pip to directly access the source repository
pip install git+https://github.com/pyGrowler/growler-jade.git@dev
Otherwise, you can install locally via
python setup.py install
Usage
The only class the user has to worry about is JadeRenderer, which can be found in either growler_jade.JadeRenderer or the namespace growler_ext.jade_renderer.JadeRenderer. The latter method is used by the growler extension auto-importer growler.ext, making importing multiple packages very clean.
A JadeRenderer is created with a path (which must exist) which contains the template files to render. There are currently no configuration options available, but this is likely to change. This object must be added to the application via the app.use() method. In all server middleware following this object, a the ‘render’ method will be available on the response object, allowing you to render any filename found in the given renderer’s path: res.render('foo') renders foo.jade found in the path.
Example
Here is a simple script which serves a single file, path/to/views/index.jade upon request to the root page:
from growler import App
from growler.ext import JadeRenderer # do NOT import growler.ext.JadeRenderer directly
app = App("Jade Example")
app.use(JadeRenderer("path/to/views"))
@app.get("/")
def index_page(req, res):
if hasattr(req, 'user'):
data = {'username': req.user.name}
else:
data = {'username': 'Anonymous'}
# renders path/to/views/index.jade with values given data
res.render("index", data)
app.create_server_and_run_forever(host='localhost', port=9000)
Contributing
Contributions are welcome that follow the Growler Contribution Guidelines.
License
No license has been chosen.
Metadata
Release files for growler-jade 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| growler-jade-0.0.1.tar.gz | 4.4 kB | Without provenance | Details for growler-jade-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| growler_jade-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for growler_jade-0.0.1-py3-none-any.whl |
Total release size: 9.6 kB
Release files / growler-jade-0.0.1.tar.gz
| Download URL | growler-jade-0.0.1.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bc9f836326c499270ad71392b8f2ae23ee5606eb279122f72322cb5b2c3462e
|
|
BLAKE2b-256 checksum How to use checksums |
e00c0aeca401160aee40d98e49bbca8bd2a8d30e7c8d85521fadbcef294a58d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / growler_jade-0.0.1-py3-none-any.whl
| Download URL | growler_jade-0.0.1-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4436a8db38d8a4bb97f9d2ab78ba08a2e2aedebb3d7f1ea70d96150b518cff99
|
|
BLAKE2b-256 checksum How to use checksums |
5ea722109acf81616276bae72406cad2fb163f6317fd7e891c11541dfac620f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for growler-jade 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.