From 29a80354ab5e5b85fa37863f70b1cf95646dc699 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Wed, 6 Jun 2012 10:32:03 +0200 Subject: [PATCH] Added alt attribute to img tags in docs. This is a good practice for accessibility. Thanks Jessica McKellar for the report. --- docs/howto/static-files.txt | 8 ++++---- docs/intro/overview.txt | 2 +- docs/ref/contrib/staticfiles.txt | 4 ++-- docs/ref/models/fields.txt | 6 +++--- docs/ref/templates/builtins.txt | 13 +++++++------ 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/howto/static-files.txt b/docs/howto/static-files.txt index 29a2c2f6e2..db76c24742 100644 --- a/docs/howto/static-files.txt +++ b/docs/howto/static-files.txt @@ -68,7 +68,7 @@ Basic usage .. code-block:: html+django - + Hi! See :ref:`staticfiles-in-templates` for more details, **including** an alternate method using a template tag. @@ -131,7 +131,7 @@ You could, of course, simply hardcode the path to you assets in the templates: .. code-block:: html - + Sample image Of course, there are some serious problems with this: it doesn't work well in development, and it makes it *very* hard to change where you've deployed your @@ -167,7 +167,7 @@ Once that's done, you can refer to :setting:`STATIC_URL` in your templates: .. code-block:: html+django - + Hi! If ``{{ STATIC_URL }}`` isn't working in your template, you're probably not using :class:`~django.template.RequestContext` when rendering the template. @@ -193,7 +193,7 @@ tag. It builds the URL for the given relative path by using the configured .. code-block:: html+django {% load staticfiles %} - + Hi! It is also able to consume standard context variables, e.g. assuming a ``user_stylesheet`` variable is passed to the template: diff --git a/docs/intro/overview.txt b/docs/intro/overview.txt index bd2fdfdb6c..49233fb8a7 100644 --- a/docs/intro/overview.txt +++ b/docs/intro/overview.txt @@ -279,7 +279,7 @@ Here's what the "base.html" template might look like: {% block title %}{% endblock %} - Logo + Logo {% block content %}{% endblock %} diff --git a/docs/ref/contrib/staticfiles.txt b/docs/ref/contrib/staticfiles.txt index 2bdf825316..126bcdd4e6 100644 --- a/docs/ref/contrib/staticfiles.txt +++ b/docs/ref/contrib/staticfiles.txt @@ -380,10 +380,10 @@ full URL for the given relative path, e.g.: .. code-block:: html+django {% load static from staticfiles %} - + Hi! The previous example is equal to calling the ``url`` method of an instance of -:setting:`STATICFILES_STORAGE` with ``"css/base.css"``. This is especially +:setting:`STATICFILES_STORAGE` with ``"images/hi.jpg"``. This is especially useful when using a non-local storage backend to deploy files as documented in :ref:`staticfiles-from-cdn`. diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index eab7ad91e1..86894effea 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -683,7 +683,7 @@ directory on the filesystem. Has three special arguments, of which the first is Optional. A regular expression, as a string, that :class:`FilePathField` will use to filter filenames. Note that the regex will be applied to the base filename, not the full path. Example: ``"foo.*\.txt$"``, which will - match a file called ``foo23.txt`` but not ``bar.txt`` or ``foo23.gif``. + match a file called ``foo23.txt`` but not ``bar.txt`` or ``foo23.png``. .. attribute:: FilePathField.recursive @@ -714,9 +714,9 @@ base filename, not the full path. So, this example:: FilePathField(path="/home/images", match="foo.*", recursive=True) -...will match ``/home/images/foo.gif`` but not ``/home/images/foo/bar.gif`` +...will match ``/home/images/foo.png`` but not ``/home/images/foo/bar.png`` because the :attr:`~FilePathField.match` applies to the base filename -(``foo.gif`` and ``bar.gif``). +(``foo.png`` and ``bar.png``). By default, :class:`FilePathField` instances are created as ``varchar(100)`` columns in your database. As with other fields, you diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 5019963f60..bc86cb6919 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -1069,7 +1069,8 @@ value to a maximum value, and then applies that ratio to a constant. For example:: - + Bar Above, if ``this_value`` is 175 and ``max_value`` is 200, the image in the above example will be 88 pixels wide (because 175/200 = .875; .875 * 100 = 87.5 @@ -2361,7 +2362,7 @@ using :class:`~django.template.RequestContext` or not. .. code-block:: html+django {% load static %} - + Hi! It is also able to consume standard context variables, e.g. assuming a ``user_stylesheet`` variable is passed to the template: @@ -2380,7 +2381,7 @@ It is also able to consume standard context variables, e.g. assuming a :ref:`using a cloud service to serve static files`:: {% load static from staticfiles %} - + Hi! .. templatetag:: get_static_prefix @@ -2395,7 +2396,7 @@ into the template, you can use the :ttag:`get_static_prefix` template tag instead:: {% load static %} - + Hi! There's also a second form you can use to avoid extra processing if you need the value multiple times:: @@ -2403,8 +2404,8 @@ the value multiple times:: {% load static %} {% get_static_prefix as STATIC_PREFIX %} - - + Hi! + Hello! .. templatetag:: get_media_prefix