Knitr rendering for Flask-FlatPages
Project description
Flask-FlatPages-Knitr preprocesses a Flask FlatPage using knitr such that code chunks are evaluated before the next step in the rendering process occurs.
Quickstart
First, install the knitr R package:
Rscript -e "install.packages('knitr')"
Second, install Flask-FlatPages-Knitr from the Python Package Index:
pip install Flask-FlatPages-Knitr
Then you can simply add Flask-FlatPages-Knitr to your app:
from flask import Flask
from flask_flatpages import FlatPages
from flask_flatpages_knitr import FlatPagesKnitr
app = Flask(__name__)
app.config.from_object(__name__)
pages = FlatPages(app)
FlatPagesKnitr(app)
By default, FLATPAGES_HTML_RENDERER will be reused, which defaults to a Markdown implementation for Python. For more advanced Markdown rendering, Flask-FlatPages-Pandoc is recommended.
Links
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for Flask-FlatPages-Knitr-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ccbab807afabbfda3ff2ee5aef619072334e914ecdb36acf9242a3262a8e89e |
|
MD5 | 29159800231500e53136ab42a0b30312 |
|
BLAKE2b-256 | fdab9cd7d801a858846efb7f4b0da05bd643946979c9c86071176cbfb59a59a7 |