From 1853e2dbf2e290ec04e3389d523bbe4bad94a42e Mon Sep 17 00:00:00 2001 From: Curtis Maloney Date: Tue, 11 Sep 2018 03:00:34 +1000 Subject: [2.1.x] Refs #20910 -- Replaced snippet directive with code-block. Backport of c49ea6f5911296dcb40190c905e38b43cdc7c7a3 from master --- docs/intro/tutorial03.txt | 52 +++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'docs/intro/tutorial03.txt') diff --git a/docs/intro/tutorial03.txt b/docs/intro/tutorial03.txt index 32c0c99fd1..de84ad0612 100644 --- a/docs/intro/tutorial03.txt +++ b/docs/intro/tutorial03.txt @@ -64,8 +64,8 @@ Writing more views Now let's add a few more views to ``polls/views.py``. These views are slightly different, because they take an argument: -.. snippet:: - :filename: polls/views.py +.. code-block:: python + :caption: polls/views.py def detail(request, question_id): return HttpResponse("You're looking at question %s." % question_id) @@ -80,8 +80,8 @@ slightly different, because they take an argument: Wire these new views into the ``polls.urls`` module by adding the following :func:`~django.urls.path` calls: -.. snippet:: - :filename: polls/urls.py +.. code-block:: python + :caption: polls/urls.py from django.urls import path @@ -147,8 +147,8 @@ in :doc:`Tutorial 2 `. Here's one stab at a new ``index()`` view, which displays the latest 5 poll questions in the system, separated by commas, according to publication date: -.. snippet:: - :filename: polls/views.py +.. code-block:: python + :caption: polls/views.py from django.http import HttpResponse @@ -196,8 +196,8 @@ Django simply as ``polls/index.html``. Put the following code in that template: -.. snippet:: html+django - :filename: polls/templates/polls/index.html +.. code-block:: html+django + :caption: polls/templates/polls/index.html {% if latest_question_list %}