Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Knitr preprocessing for Flask-FlatPages

Project description


.. image::

.. image::

Flask-FlatPages-Knitr preprocesses a `Flask <>`_
`FlatPage <>`_
using `knitr <>`_ such that
code chunks are evaluated before the next step in the rendering
process occurs.


First, install the `knitr <>`_ R package:

.. code:: bash

Rscript -e "install.packages('knitr')"

Right now, Flask-FlatPages-Knitr requires at least version 0.6 of Flat-FlatPages,
which has not been released yet. Hence, you'll have to install it from Github:

.. code:: bash

pip install git+git://

Second, install Flask-FlatPages-Knitr from the Python Package Index:

.. code:: bash

pip install Flask-FlatPages-Knitr

Finally, you can simply add Flask-FlatPages-Knitr to your app:

.. code:: python

from flask import Flask
from flask_flatpages import FlatPages
from flask_flatpages_knitr import FlatPagesKnitr

app = Flask(__name__)

pages = FlatPages(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:

.. code:: python

from flask_flatpages_pandoc import FlatPagesPandoc


pages = FlatPages(app)
FlatPagesPandoc("markdown", "app", ["--mathjax"], pre_render=True)


* `Demo Page <>`_
* `GitHub Page <>`_
* `PyPI <>`_

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for Flask-FlatPages-Knitr, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size Flask-FlatPages-Knitr-0.2.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page