summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorCurtis Maloney <curtis@tinbrain.net>2018-09-11 03:00:34 +1000
committerTim Graham <timograham@gmail.com>2018-09-10 13:00:34 -0400
commitc49ea6f5911296dcb40190c905e38b43cdc7c7a3 (patch)
tree56d6341ed09e5d77cd3361bcc5275eab5733db4a /docs/ref
parentf8ff529ee32c79b270176f5e8d7a3f6ef048ac31 (diff)
Refs #20910 -- Replaced snippet directive with code-block.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/admin/index.txt20
-rw-r--r--docs/ref/contrib/admin/javascript.txt8
-rw-r--r--docs/ref/models/expressions.txt4
-rw-r--r--docs/ref/models/fields.txt8
-rw-r--r--docs/ref/templates/language.txt16
5 files changed, 28 insertions, 28 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index d317ad4083..c28453006c 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -2929,8 +2929,8 @@ instantiate any other Python class) and register your models and
``ModelAdmin`` subclasses with it instead of with the default site. Finally,
update :file:`myproject/urls.py` to reference your :class:`AdminSite` subclass.
-.. snippet::
- :filename: myapp/admin.py
+.. code-block:: python
+ :caption: myapp/admin.py
from django.contrib.admin import AdminSite
@@ -2943,8 +2943,8 @@ update :file:`myproject/urls.py` to reference your :class:`AdminSite` subclass.
admin_site.register(MyModel)
-.. snippet::
- :filename: myproject/urls.py
+.. code-block:: python
+ :caption: myproject/urls.py
from django.urls import path
@@ -2972,24 +2972,24 @@ You can override the default ``django.contrib.admin.site`` by setting the
to the dotted import path of either a ``AdminSite`` subclass or a callable that
returns a site instance.
-.. snippet::
- :filename: myproject/admin.py
+.. code-block:: python
+ :caption: myproject/admin.py
from django.contrib import admin
class MyAdminSite(admin.AdminSite):
...
-.. snippet::
- :filename: myproject/apps.py
+.. code-block:: python
+ :caption: myproject/apps.py
from django.contrib.admin.apps import AdminConfig
class MyAdminConfig(AdminConfig):
default_site = 'myproject.admin.MyAdminSite'
-.. snippet::
- :filename: myproject/settings.py
+.. code-block:: python
+ :caption: myproject/settings.py
INSTALLED_APPS = [
...
diff --git a/docs/ref/contrib/admin/javascript.txt b/docs/ref/contrib/admin/javascript.txt
index 52374800b4..bf94655f38 100644
--- a/docs/ref/contrib/admin/javascript.txt
+++ b/docs/ref/contrib/admin/javascript.txt
@@ -31,8 +31,8 @@ In your custom ``change_form.html`` template, extend the
<script type="text/javascript" src="{% static 'app/formset_handlers.js' %}"></script>
{% endblock %}
-.. snippet:: javascript
- :filename: app/static/app/formset_handlers.js
+.. code-block:: javascript
+ :caption: app/static/app/formset_handlers.js
(function($) {
$(document).on('formset:added', function(event, $row, formsetName) {
@@ -69,8 +69,8 @@ namespace, just listen to the event triggered from there. For example:
<script type="text/javascript" src="{% static 'app/unregistered_handlers.js' %}"></script>
{% endblock %}
-.. snippet:: javascript
- :filename: app/static/app/unregistered_handlers.js
+.. code-block:: javascript
+ :caption: app/static/app/unregistered_handlers.js
django.jQuery(document).on('formset:added', function(event, $row, formsetName) {
// Row added
diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt
index 281b3144ae..2f2629cc69 100644
--- a/docs/ref/models/expressions.txt
+++ b/docs/ref/models/expressions.txt
@@ -314,8 +314,8 @@ The ``Func`` API is as follows:
``arg_joiner``, and any other ``**extra_context`` parameters to
customize the SQL as needed. For example:
- .. snippet::
- :filename: django/db/models/functions.py
+ .. code-block:: python
+ :caption: django/db/models/functions.py
class ConcatPair(Func):
...
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index c66b600130..8c3f9ae7ba 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -1194,8 +1194,8 @@ Relationships defined this way on :ref:`abstract models
<abstract-base-classes>` are resolved when the model is subclassed as a
concrete model and are not relative to the abstract model's ``app_label``:
-.. snippet::
- :filename: products/models.py
+.. code-block:: python
+ :caption: products/models.py
from django.db import models
@@ -1205,8 +1205,8 @@ concrete model and are not relative to the abstract model's ``app_label``:
class Meta:
abstract = True
-.. snippet::
- :filename: production/models.py
+.. code-block:: python
+ :caption: production/models.py
from django.db import models
from products.models import AbstractCar
diff --git a/docs/ref/templates/language.txt b/docs/ref/templates/language.txt
index a10cfde03b..1287f012c2 100644
--- a/docs/ref/templates/language.txt
+++ b/docs/ref/templates/language.txt
@@ -559,8 +559,8 @@ The auto-escaping tag passes its effect onto templates that extend the
current one as well as templates included via the :ttag:`include` tag,
just like all block tags. For example:
-.. snippet::
- :filename: base.html
+.. code-block:: html+django
+ :caption: base.html
{% autoescape off %}
<h1>{% block title %}{% endblock %}</h1>
@@ -568,8 +568,8 @@ just like all block tags. For example:
{% endblock %}
{% endautoescape %}
-.. snippet::
- :filename: child.html
+.. code-block:: html+django
+ :caption: child.html
{% extends "base.html" %}
{% block title %}This &amp; that{% endblock %}
@@ -649,15 +649,15 @@ of all comments related to the current task with::
And of course you can easily access methods you've explicitly defined on your
own models:
-.. snippet::
- :filename: models.py
+.. code-block:: python
+ :caption: models.py
class Task(models.Model):
def foo(self):
return "bar"
-.. snippet::
- :filename: template.html
+.. code-block:: html+django
+ :caption: template.html
{{ task.foo }}