Permalink
Browse files

enable textile filter for templates

  • Loading branch information...
1 parent bd66283 commit 07b5bff656009f1b0befb680846f4ffc34ecd6de @mapleoin committed Sep 19, 2012
Showing with 6 additions and 2 deletions.
  1. +2 −1 pip-requires
  2. +3 −0 popcorn/__init__.py
  3. +1 −1 setup.py
View
@@ -1,3 +1,4 @@
Flask
psycopg2
-sqlalchemy
+sqlalchemy
+textile
View
@@ -21,7 +21,9 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
+
from flask import Flask, url_for, request
+from textile import textile
from popcorn.database import db_session
@@ -43,3 +45,4 @@ def url_for_other_page(page=None):
return url_for(request.endpoint, **args)
app.jinja_env.globals['url_for_other_page'] = url_for_other_page
+app.jinja_env.filters['textile'] = lambda value: textile(value)
View
@@ -13,6 +13,6 @@
packages=find_packages(exclude=["*.test", "test", "*.test.*"]),
include_package_data=True,
zip_safe=False,
- install_requires=['Flask', 'sqlalchemy', 'psycopg2'],
+ install_requires=['Flask', 'sqlalchemy', 'psycopg2', 'textile'],
test_suite="popcorn.test"
)

0 comments on commit 07b5bff

Please sign in to comment.