diff options
| author | Anshul Zilpe <anshulzilpe@gmail.com> | 2025-12-08 23:09:21 +0530 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2026-05-08 12:45:50 +0200 |
| commit | 8cec44a35d8f38284f2ea52f2f338a7154d86afb (patch) | |
| tree | d9d97b0047985cd857bcc7ed0fb95569db321cae /docs | |
| parent | 2469b99c2217d08c4772578469c6499b3d18ba7c (diff) | |
Add djade linter and format templates.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/templates/base_docs.html | 8 | ||||
| -rw-r--r-- | docs/templates/docs/doc.html | 68 | ||||
| -rw-r--r-- | docs/templates/docs/genindex.html | 12 | ||||
| -rw-r--r-- | docs/templates/docs/py-modindex.html | 10 | ||||
| -rw-r--r-- | docs/templates/docs/search_description.xml | 6 | ||||
| -rw-r--r-- | docs/templates/docs/search_results.html | 9 |
6 files changed, 61 insertions, 52 deletions
diff --git a/docs/templates/base_docs.html b/docs/templates/base_docs.html index 82d6a3a7..d4484cb2 100644 --- a/docs/templates/base_docs.html +++ b/docs/templates/base_docs.html @@ -3,14 +3,14 @@ {% block html_language_code %}{{ lang|default:"en" }}{% endblock %} -{% block title %}{% trans 'Django Documentation' %}{% endblock %} +{% block title %}{% translate 'Django Documentation' %}{% endblock %} {% block header-classes %} container--flex container--flex--wrap--mobile -{% endblock %} +{% endblock header-classes %} {% block header %} - <p><a href="{% block doc_url %}{% url 'homepage' %}{% endblock %}">{% trans 'Documentation' %}</a></p> -{% endblock %} + <p><a href="{% block doc_url %}{% url 'homepage' %}{% endblock %}">{% translate 'Documentation' %}</a></p> +{% endblock header %} {% block layout_class %}sidebar-right{% endblock %} diff --git a/docs/templates/docs/doc.html b/docs/templates/docs/doc.html index 8bce6c2f..73655fd4 100644 --- a/docs/templates/docs/doc.html +++ b/docs/templates/docs/doc.html @@ -1,8 +1,9 @@ {% extends "base_docs.html" %} -{% load i18n fundraising_extras docs %} +{% load docs fundraising_extras i18n %} -{% block title %}{{ doc.title|striptags|safe }} | {% trans "Django documentation" %}{% endblock %} -{% block og_title %}{{ doc.title|striptags }} | {% trans "Django documentation" %}{% endblock %} +{% block title %}{{ doc.title|striptags|safe }} | {% translate "Django documentation" %}{% endblock %} + +{% block og_title %}{{ doc.title|striptags }} | {% translate "Django documentation" %}{% endblock %} {% block doc_url %}{% url 'document-index' lang=lang version=version host 'docs' %}{% endblock %} @@ -31,23 +32,23 @@ <link rel="search" type="application/opensearchdescription+xml" href="{% url 'document-search-description' lang=lang version=version host 'docs' %}" - title="{% trans "Django documentation" %}"> + title="{% translate "Django documentation" %}"> {% endblock link_rel_tags %} {% block before_header %} {% if release.is_dev %} {% if "internals" not in docurl %}{# The dev version is canonical for internals/. #} <div id="dev-warning" class="doc-floating-warning"> - {% trans "This document is for Django's development version, which can be significantly different from previous releases. For older releases, use the version selector floating in the bottom right corner of this page." %} + {% translate "This document is for Django's development version, which can be significantly different from previous releases. For older releases, use the version selector floating in the bottom right corner of this page." %} </div> {% endif %} {% elif release.is_preview %} <div id="dev-warning" class="doc-floating-warning"> - {% trans "This document is for a preview release of Django, which can be significantly different from previous releases. For older releases, use the version selector floating in the bottom right corner of this page." %} + {% translate "This document is for a preview release of Django, which can be significantly different from previous releases. For older releases, use the version selector floating in the bottom right corner of this page." %} </div> {% elif not release.is_supported %} <div id="outdated-warning" class="doc-floating-warning"> - {% trans "This document is for an insecure version of Django that is no longer supported. Please upgrade to a newer release!" %} + {% translate "This document is for an insecure version of Django that is no longer supported. Please upgrade to a newer release!" %} </div> {% endif %} {% endblock before_header %} @@ -57,13 +58,13 @@ <ul id="faq-link"> <li class="current-link"> <a href="{% url 'document-detail' lang=lang version=version url='faq/help' host 'docs' %}"> - <span>{% trans "Getting Help" %}</span> + <span>{% translate "Getting Help" %}</span> </a> </li> </ul> <ul id="doc-languages" class="language-switcher doc-switcher"> <li class="current"> - <button>{% trans "Language:" %} <strong>{{ lang }}</strong></button> + <button>{% translate "Language:" %} <strong>{{ lang }}</strong></button> </li> {% for available_lang in available_languages reversed %} {% if lang != available_lang %} @@ -82,7 +83,7 @@ {% get_all_doc_versions docurl as other_versions %} <ul id="doc-versions" class="version-switcher doc-switcher"> <li class="current {% if release.is_dev %}dev{% endif %}"> - <button>{% trans "Documentation version:" %} + <button>{% translate "Documentation version:" %} <strong>{% if release.is_dev %}development{% else %}{{ version }}{% endif %}</strong> </button> </li> @@ -126,7 +127,6 @@ {% endblock content %} - {% block content-related %} <div role="complementary"> <h2 class="visuallyhidden" id="aside-header">{% translate "Additional Information" %}</h2> @@ -134,7 +134,7 @@ {% donation_snippet %} {% block toc-wrapper %} - <h3>{% trans "Contents" %}</h3> + <h3>{% translate "Contents" %}</h3> {% block toc %} {{ doc.toc|safe }} {% endblock toc %} @@ -142,16 +142,16 @@ {% block browse-wrapper %} <nav aria-labelledby="browse-header"> - <h3 id="browse-header">{% trans "Browse" %}</h3> + <h3 id="browse-header">{% translate "Browse" %}</h3> <ul> {% block browse %} {% if doc.prev %} - <li>{% trans "Prev:" %} <a rel="prev" href="{{ doc.prev.link }}">{{ doc.prev.title|safe }}</a></li> + <li>{% translate "Prev:" %} <a rel="prev" href="{{ doc.prev.link }}">{{ doc.prev.title|safe }}</a></li> {% endif %} {% if doc.next %} - <li>{% trans "Next:" %} <a rel="next" href="{{ doc.next.link }}">{{ doc.next.title|safe }}</a></li> + <li>{% translate "Next:" %} <a rel="next" href="{{ doc.next.link }}">{{ doc.next.title|safe }}</a></li> {% endif %} - <li><a href="{% url 'document-detail' lang=lang version=version url="contents" host 'docs' %}">{% trans "Table of contents" %}</a></li> + <li><a href="{% url 'document-detail' lang=lang version=version url="contents" host 'docs' %}">{% translate "Table of contents" %}</a></li> {% for doc, title, accesskey, shorttitle in env.rellinks %} <li><a href="{% url 'document-detail' lang=lang version=version url=doc host 'docs' %}">{{ title }}</a></li> {% endfor %} @@ -162,14 +162,14 @@ {% block breadcrumbs-wrapper %} <nav aria-labelledby="breadcrumbs-header"> - <h3 id="breadcrumbs-header">{% trans "You are here:" %}</h3> + <h3 id="breadcrumbs-header">{% translate "You are here:" %}</h3> <ul> <li> - <a href="{% url 'document-index' lang=lang version=version host 'docs' %}">{% blocktrans %}Django {{ version }} documentation{% endblocktrans %}</a> + <a href="{% url 'document-index' lang=lang version=version host 'docs' %}">{% blocktranslate %}Django {{ version }} documentation{% endblocktranslate %}</a> {% for p in doc.parents %} <ul><li><a href="{{ p.link }}">{{ p.title|safe }}</a> {% endfor %} - <ul><li>{% block current-page-title %}{{ doc.title|safe }}{% endblock current-page-title %}</li></ul> + <ul><li>{% block current-page-title %}{{ doc.title|safe }}{% endblock %}</li></ul> {% for p in doc.parents %}</li></ul>{% endfor %} </li> </ul> @@ -178,38 +178,38 @@ {% block help-wrapper %} <section aria-labelledby="getting-help-sidebar"> - <h3 id="getting-help-sidebar">{% trans "Getting help" %}</h3> + <h3 id="getting-help-sidebar">{% translate "Getting help" %}</h3> <dl class="list-links"> - <dt><a href="{% url 'document-detail' lang=lang version=version url="faq" host 'docs' %}">{% trans "FAQ" %}</a></dt> - <dd>{% blocktrans %}Try the FAQ — it's got answers to many common questions.{% endblocktrans %}</dd> + <dt><a href="{% url 'document-detail' lang=lang version=version url="faq" host 'docs' %}">{% translate "FAQ" %}</a></dt> + <dd>{% blocktranslate %}Try the FAQ — it's got answers to many common questions.{% endblocktranslate %}</dd> - <dt><a href="{% url 'document-detail' lang='en' version='stable' url='genindex' host 'docs' %}">{% trans "Index" %}</a>, <a href="{% url 'document-detail' lang='en' version='stable' url='py-modindex' host 'docs' %}">{% trans "Module Index" %}</a>, or <a href="{% url 'document-detail' lang='en' version='stable' url='contents' host 'docs' %}">{% trans "Table of Contents" %}</a></dt> - <dd>{% blocktrans %}Handy when looking for specific information.{% endblocktrans %}</dd> + <dt><a href="{% url 'document-detail' lang='en' version='stable' url='genindex' host 'docs' %}">{% translate "Index" %}</a>, <a href="{% url 'document-detail' lang='en' version='stable' url='py-modindex' host 'docs' %}">{% translate "Module Index" %}</a>, or <a href="{% url 'document-detail' lang='en' version='stable' url='contents' host 'docs' %}">{% translate "Table of Contents" %}</a></dt> + <dd>{% blocktranslate %}Handy when looking for specific information.{% endblocktranslate %}</dd> - <dt><a href="https://chat.djangoproject.com">{% trans "Django Discord Server" %}</a></dt> - <dd>{% blocktrans %}Join the Django Discord Community.{% endblocktrans %}</dd> + <dt><a href="https://chat.djangoproject.com">{% translate "Django Discord Server" %}</a></dt> + <dd>{% blocktranslate %}Join the Django Discord Community.{% endblocktranslate %}</dd> - <dt><a href="https://forum.djangoproject.com/">{% trans "Official Django Forum" %}</a></dt> - <dd>{% blocktrans %}Join the community on the Django Forum.{% endblocktrans %}</dd> + <dt><a href="https://forum.djangoproject.com/">{% translate "Official Django Forum" %}</a></dt> + <dd>{% blocktranslate %}Join the community on the Django Forum.{% endblocktranslate %}</dd> - <dt><a href="https://code.djangoproject.com/">{% trans "Ticket tracker" %}</a></dt> - <dd>{% blocktrans %}Report bugs with Django or Django documentation in our ticket tracker.{% endblocktrans %}</dd> + <dt><a href="https://code.djangoproject.com/">{% translate "Ticket tracker" %}</a></dt> + <dd>{% blocktranslate %}Report bugs with Django or Django documentation in our ticket tracker.{% endblocktranslate %}</dd> </dl> </section> {% endblock help-wrapper %} {% block links-wrapper %} <section aria-labelledby="links-wrapper-header"> - <h3 id="links-wrapper-header">{% trans "Download:" %}</h3> + <h3 id="links-wrapper-header">{% translate "Download:" %}</h3> <p> - {% if version == "dev" %}{% trans "Offline (development version):" %} - {% else %}{% blocktrans %}Offline (Django {{ version }}):{% endblocktrans %}{% endif %} + {% if version == "dev" %}{% translate "Offline (development version):" %} + {% else %}{% blocktranslate %}Offline (Django {{ version }}):{% endblocktranslate %}{% endif %} <a href="{{ MEDIA_URL }}docs/django-docs-{{ version }}-{{ lang }}.zip">HTML</a> | <a href="https://media.readthedocs.org/pdf/django/{{ rtd_version }}/django.pdf">PDF</a> | <a href="https://media.readthedocs.org/epub/django/{{ rtd_version }}/django.epub">ePub</a> <br> <span class="quiet"> - {% blocktrans %}Provided by <a href="https://readthedocs.org/">Read the Docs</a>.{% endblocktrans %} + {% blocktranslate %}Provided by <a href="https://readthedocs.org/">Read the Docs</a>.{% endblocktranslate %} </span> </p> </section> diff --git a/docs/templates/docs/genindex.html b/docs/templates/docs/genindex.html index 840ef5ed..a0e0eee5 100644 --- a/docs/templates/docs/genindex.html +++ b/docs/templates/docs/genindex.html @@ -1,12 +1,14 @@ {% extends "docs/doc.html" %} {% load i18n %} -{% block title %}{% trans "General Index | Django Documentation" %}{% endblock %} +{% block title %}{% translate "General Index | Django Documentation" %}{% endblock %} + {% block toc-wrapper %}{% endblock %} -{% block current-page-title %}{% trans "General Index" %}{% endblock %} + +{% block current-page-title %}{% translate "General Index" %}{% endblock %} {% block body %} - <h1>{% trans "General Index" %}</h1> + <h1>{% translate "General Index" %}</h1> <p class="indexletters"> {% for letter, _ in doc.genindexentries %} @@ -36,11 +38,11 @@ {% for subname, sublinks in contents.1 %} <dd> <a href="{{ sublinks.0.1 }}">{{ subname }}</a> - {% for link in sublinks|slice:"1:" %}, <a href="{{ link.1 }}">{% trans "[Link]" %}</a>{% endfor %} + {% for link in sublinks|slice:"1:" %}, <a href="{{ link.1 }}">{% translate "[Link]" %}</a>{% endfor %} </dd> {% endfor %} {% endif %} {% endfor %} </dl> {% endfor %} -{% endblock %} +{% endblock body %} diff --git a/docs/templates/docs/py-modindex.html b/docs/templates/docs/py-modindex.html index b40a8519..e052b4c9 100644 --- a/docs/templates/docs/py-modindex.html +++ b/docs/templates/docs/py-modindex.html @@ -1,12 +1,14 @@ {% extends "docs/doc.html" %} {% load i18n %} -{% block title %}{% trans "Module Index | Django Documentation" %}{% endblock %} +{% block title %}{% translate "Module Index | Django Documentation" %}{% endblock %} + {% block toc-wrapper %}{% endblock %} -{% block current-page-title %}{% trans "Module Index" %}{% endblock %} + +{% block current-page-title %}{% translate "Module Index" %}{% endblock %} {% block body %} - <h1>{% trans "Module Index" %}</h1> + <h1>{% translate "Module Index" %}</h1> <ul class="jump_links"> {% for letter, objects in doc.content %} @@ -31,4 +33,4 @@ </ul> {% endfor %} -{% endblock %} +{% endblock body %} diff --git a/docs/templates/docs/search_description.xml b/docs/templates/docs/search_description.xml index dd8f0a38..bd699af2 100644 --- a/docs/templates/docs/search_description.xml +++ b/docs/templates/docs/search_description.xml @@ -1,14 +1,14 @@ {% load i18n static %}<?xml version="1.0" encoding="UTF-8"?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/"> - <ShortName>{% blocktrans with version=release.human_version %}Django {{ version }} documentation{% endblocktrans %}</ShortName> - <Description>{% blocktrans with version=release.human_version %}Search Django {{ version }} documentation{% endblocktrans %}</Description> + <ShortName>{% blocktranslate with version=release.human_version %}Django {{ version }} documentation{% endblocktranslate %}</ShortName> + <Description>{% blocktranslate with version=release.human_version %}Search Django {{ version }} documentation{% endblocktranslate %}</Description> <InputEncoding>UTF-8</InputEncoding> <OutputEncoding>UTF-8</OutputEncoding> <Image width="16" height="16" type="image/x-icon">{% static "img/favicon.ico" %}</Image> <Image width="32" height="32" type="image/x-icon">{% static "img/favicon.ico" %}</Image> <Query role="example" searchTerms="testing" /> - <Developer>{% trans "Django team" %}</Developer> + <Developer>{% translate "Django team" %}</Developer> <SyndicationRight>open</SyndicationRight> <AdultContent>false</AdultContent> <Language>{{ release.lang }}</Language> diff --git a/docs/templates/docs/search_results.html b/docs/templates/docs/search_results.html index 7c01601f..551d0649 100644 --- a/docs/templates/docs/search_results.html +++ b/docs/templates/docs/search_results.html @@ -1,13 +1,18 @@ {% extends "docs/doc.html" %} -{% load i18n docs %} +{% load docs i18n %} {% block title %}{% translate "Search" %}{% endblock %} + {% block header %}<h1>{% translate "Search" %}</h1>{% endblock %} {% block toc-wrapper %}{% endblock %} + {% block breadcrumbs-wrapper %}{% endblock %} + {% block last-update-wrapper %}{% endblock %} + {% block browse-wrapper %}{% endblock %} + {% block links-wrapper %}{% endblock %} {% block body %} @@ -105,4 +110,4 @@ {% endif %} {% endif %} -{% endblock %} +{% endblock body %} |
