From ae71632862033149e73c1c0624de9fcad2d0fac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Puente=20Sarr=C3=ADn?= Date: Thu, 9 May 2013 14:39:53 -0500 Subject: [PATCH 1/2] Changed lexer in tutorial: from html to html+django --- ...elog-application-with-django-mongodb-engine.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/tutorial/write-a-tumblelog-application-with-django-mongodb-engine.txt b/source/tutorial/write-a-tumblelog-application-with-django-mongodb-engine.txt index ac12e296126..6b8ccc86295 100644 --- a/source/tutorial/write-a-tumblelog-application-with-django-mongodb-engine.txt +++ b/source/tutorial/write-a-tumblelog-application-with-django-mongodb-engine.txt @@ -281,7 +281,7 @@ following: Then add a base template that all others can inherit from. Add the following to :file:`templates/base.html`: -.. code-block:: html +.. code-block:: html+django @@ -317,7 +317,7 @@ Create the frontpage for the blog, which should list all the posts. Add the following template to the :file:`templates/tumblelog/post_list.html`: -.. code-block:: html +.. code-block:: html+django {% extends "base.html" %} @@ -337,7 +337,7 @@ posts. Add the following template to the Finally, add :file:`templates/tumblelog/post_detail.html` for the individual posts: -.. code-block:: html +.. code-block:: html+django {% extends "base.html" %} @@ -457,7 +457,7 @@ Finally, you can add the form to the templates, so that readers can create comments. Splitting the template for the forms out into :file:`templates/_forms.html` will allow maximum reuse of forms code: -.. code-block:: html +.. code-block:: html+django
{% for field in form.visible_fields %} @@ -485,7 +485,7 @@ create comments. Splitting the template for the forms out into After the comments section in :file:`post_detail.html` add the following code to generate the comments form: -.. code-block:: html +.. code-block:: html+django

Add a comment

@@ -640,7 +640,7 @@ display to handle and output the different post types. In the :file:`post_list.html` file, change the post output display to resemble the following: -.. code-block:: html +.. code-block:: html+django {% if post.post_type == 'p' %}

{{ post.body|truncatewords:20 }}

@@ -659,7 +659,7 @@ resemble the following: In the :file:`post_detail.html` file, change the output for full posts: -.. code-block:: html +.. code-block:: html+django {% if post.post_type == 'p' %}

{{ post.body }}

From d9a6ed8f7f7b7dd5f791f2427bf669a05258b7ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Puente=20Sarr=C3=ADn?= Date: Thu, 9 May 2013 14:49:48 -0500 Subject: [PATCH 2/2] Changed lexer in tutorial: from html to html+jinja --- ...log-application-with-flask-mongoengine.txt | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/source/tutorial/write-a-tumblelog-application-with-flask-mongoengine.txt b/source/tutorial/write-a-tumblelog-application-with-flask-mongoengine.txt index ce41611d654..845c03663d0 100644 --- a/source/tutorial/write-a-tumblelog-application-with-flask-mongoengine.txt +++ b/source/tutorial/write-a-tumblelog-application-with-flask-mongoengine.txt @@ -337,7 +337,7 @@ Create a base template. All other templates will inherit from this template, which should exist in the :file:`templates/base.html` file: -.. code-block:: html +.. code-block:: html+jinja @@ -376,7 +376,7 @@ Continue by creating a landing page for the blog that will list all posts. Add the following to the :file:`templates/posts/list.html` file: -.. code-block:: html +.. code-block:: html+jinja {% extends "base.html" %} @@ -397,7 +397,7 @@ file: Finally, add :file:`templates/posts/detail.html` template for the individual posts: -.. code-block:: html +.. code-block:: html+jinja {% extends "base.html" %} @@ -501,7 +501,7 @@ Finally, you can add the form to the templates, so that readers can create comments. Create a macro for the forms in :file:`templates/_forms.html` will allow you to reuse the form code: -.. code-block:: html +.. code-block:: html+jinja {% macro render(form) -%}

@@ -537,7 +537,7 @@ Add the comments form to :file:`templates/posts/detail.html`. Insert an ``import`` statement at the top of the page and then output the form after displaying comments: -.. code-block:: html +.. code-block:: html+jinja {% import "_forms.html" as forms %} @@ -722,7 +722,7 @@ Create an :file:`admin` directory for the templates. Add a simple main index page for the admin in the :file:`templates/admin/base.html` file: -.. code-block:: html +.. code-block:: html+jinja {% extends "base.html" %} @@ -745,7 +745,7 @@ file: List all the posts in the :file:`templates/admin/list.html` file: -.. code-block:: html +.. code-block:: html+jinja {% extends "admin/base.html" %} @@ -771,7 +771,7 @@ List all the posts in the :file:`templates/admin/list.html` file: Add a template to create and edit posts in the :file:`templates/admin/detail.html` file: -.. code-block:: html +.. code-block:: html+jinja {% extends "admin/base.html" %} {% import "_forms.html" as forms %} @@ -871,7 +871,7 @@ logic: only modify the templates. Update the :file:`templates/posts/list.html` file and change the post output format as follows: -.. code-block:: html +.. code-block:: html+jinja {% if post.body %} {% if post.post_type == 'Quote' %} @@ -891,7 +891,7 @@ output format as follows: In the :file:`templates/posts/detail.html` change the output for full posts as follows: -.. code-block:: html +.. code-block:: html+jinja {% if post.body %} {% if post.post_type == 'Quote' %} @@ -964,7 +964,7 @@ correct model form to use: Update the :file:`template/admin/base.html` file to create a new post drop down menu in the toolbar: -.. code-block:: html +.. code-block:: html+jinja {% extends "base.html" %}