Knitr preprocessing for Flask-FlatPages
Project description
Flask-FlatPages-Knitr
---------------------
.. image:: https://travis-ci.org/fhirschmann/Flask-FlatPages-Knitr.png?branch=master
:target: https://travis-ci.org/fhirschmann/Flask-FlatPages-Knitr
.. image:: https://badge.fury.io/py/Flask-FlatPages-Knitr.png
:target: http://badge.fury.io/py/Flask-FlatPages-Knitr
Flask-FlatPages-Knitr preprocesses a `Flask <http://flask.pocoo.org/>`_
`FlatPage <http://pythonhosted.org/Flask-FlatPages/>`_
using `knitr <http://yihui.name/knitr/>`_ such that
code chunks are evaluated before the next step in the rendering
process occurs.
Quickstart
``````````
First, install the `knitr <http://yihui.name/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://github.com/SimonSapin/Flask-FlatPages/
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__)
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 <http://github.com/fhirschmann/Flask-FlatPages-Pandoc>`_
is recommended:
.. code:: python
from flask_flatpages_pandoc import FlatPagesPandoc
FLATPAGES_EXTENSION = ".Rmd"
pages = FlatPages(app)
FlatPagesPandoc("markdown", "app", ["--mathjax"], pre_render=True)
FlatPagesKnitr(app)
Links
`````
* `Demo Page <http://0x0b.de/sandbox/knitr/>`_
* `GitHub Page <http://github.com/fhirschmann/Flask-FlatPages-Knitr>`_
* `PyPI <http://pypi.python.org/pypi/Flask-FlatPages-Knitr>`_
---------------------
.. image:: https://travis-ci.org/fhirschmann/Flask-FlatPages-Knitr.png?branch=master
:target: https://travis-ci.org/fhirschmann/Flask-FlatPages-Knitr
.. image:: https://badge.fury.io/py/Flask-FlatPages-Knitr.png
:target: http://badge.fury.io/py/Flask-FlatPages-Knitr
Flask-FlatPages-Knitr preprocesses a `Flask <http://flask.pocoo.org/>`_
`FlatPage <http://pythonhosted.org/Flask-FlatPages/>`_
using `knitr <http://yihui.name/knitr/>`_ such that
code chunks are evaluated before the next step in the rendering
process occurs.
Quickstart
``````````
First, install the `knitr <http://yihui.name/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://github.com/SimonSapin/Flask-FlatPages/
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__)
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 <http://github.com/fhirschmann/Flask-FlatPages-Pandoc>`_
is recommended:
.. code:: python
from flask_flatpages_pandoc import FlatPagesPandoc
FLATPAGES_EXTENSION = ".Rmd"
pages = FlatPages(app)
FlatPagesPandoc("markdown", "app", ["--mathjax"], pre_render=True)
FlatPagesKnitr(app)
Links
`````
* `Demo Page <http://0x0b.de/sandbox/knitr/>`_
* `GitHub Page <http://github.com/fhirschmann/Flask-FlatPages-Knitr>`_
* `PyPI <http://pypi.python.org/pypi/Flask-FlatPages-Knitr>`_
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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73d132259c7b88a7d7eef7a475e94330b059ad319f756ddacf3ac601b04881e6 |
|
MD5 | dc4c0ddbd817eb49342af9fabefe0b81 |
|
BLAKE2b-256 | 8955e52cab67d4bffe9e0ef1a9b4519b3ea58cedd839d0426fe30f26028a2835 |