Skip to content

Django & Jinja lexer in tutorials #976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

<!DOCTYPE html>
<html lang="en">
Expand Down Expand Up @@ -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" %}

Expand All @@ -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" %}

Expand Down Expand Up @@ -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

<fieldset>
{% for field in form.visible_fields %}
Expand Down Expand Up @@ -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

<h2>Add a comment</h2>
<form action="." method="post">
Expand Down Expand Up @@ -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' %}
<p>{{ post.body|truncatewords:20 }}</p>
Expand All @@ -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' %}
<p>{{ post.body }}<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

<!DOCTYPE html>
<html lang="en">
Expand Down Expand Up @@ -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" %}

Expand All @@ -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" %}

Expand Down Expand Up @@ -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) -%}
<fieldset>
Expand Down Expand Up @@ -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 %}

Expand Down Expand Up @@ -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" %}

Expand All @@ -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" %}

Expand All @@ -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 %}
Expand Down Expand Up @@ -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' %}
Expand All @@ -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' %}
Expand Down Expand Up @@ -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" %}

Expand Down