summaryrefslogtreecommitdiff
path: root/docs/_ext
AgeCommit message (Collapse)Author
10 daysFixed #36022 -- Renamed django-admin to django.Ryan Hiebert
This change implements DEP 16: to rename the django-admin command to django. django-admin is kept as an alias. Docs references to the "django-admin" command are updated to "django" or “The django command”. Renamed the `django-admin` Sphinx directive to `cmd`, and the `django-admin-option` directive to `cli-option`. Thanks Johannes Maron, Mike Edmunds, and Jacob Walls for reviews.
2026-10-23Refs #35874 -- Improved documentation console tabs accessibility.Mike Edmunds
Improved accessibility for docs console tabs within constraints of the current CSS-only, hidden radio button implementation. * Switched to flex layout. (Previous `text-align: right` could cause problems in rtl scripts.) * Changed radio buttons from `display: none` to visually hidden. This allows them to participate in keyboard navigation (with or without a screen reader). * Rendered a focus outline on the visible label when the hidden radio button has focus. * Increased border widths on the active tab to allow distinguishing it with high contrast settings (forced-colors: active). * Increased contrast on inactive tab label and active tab border. * Created `--tab-*` CSS properties in `.console-block` to allow adapting to other themes or contexts (e.g., on docs.djangoproject.com). Screen readers will announce console tabs as radio buttons. (JavaScript would be needed to properly implement the WAI-ARIA tab pattern with the expected behavior for tab-group, tab, and tab-panel ARIA roles.) Thanks to Natalia Bidart (nessita), Tom Carrick, and Akintola Rahmat for their reviews and suggestions.
2026-10-14Refs #37212 -- Fixed console tabs bug on shared doctrees.Mike Edmunds
Removed a builder-specific optimization from ConsoleDirective. This fixes a bug where building with shared doctrees (as docs/Makefile does) could result in different output depending on the order of builds. The optimization did not noticeably impact Sphinx build time. This also resolves a RemovedInSphinx11Warning in ConsoleDirective.run() that "'sphinx.environment.BuildEnvironment.app' is deprecated." Thanks to @nessita for review (and for identifying this as a bug, not just a Sphinx deprecation).
2026-10-14Refs #37212 -- Removed unused code in djangodocs Sphinx extension.Mike Edmunds
`simple_option_desc_re` was added in 4239bb0 for use by parse_django_adminopt_node(). That function was removed in e519aab, which reworked `django-admin-option` using Sphinx's standard Cmdoption.
2026-10-01Fixed #37212 -- Improved djangodocs Sphinx extension portability.Mike Edmunds
* Removed unnecessary `table` and `parameterlist` customizations from the djangodocs Sphinx extension's `DjangoHTMLTranslator`. These were meant to avoid obsolete html from Docutils' html4 writer (`border=1` in `<table>` tags and and `<big>` around parameter list parens). Sphinx 2.0 switched to the html5 writer, which doesn't emit that html. These overrides are no longer necessary, rely on Sphinx internals that often break in new versions, and interfere with third-party themes. * Moved the console-tabs.css stylesheet to docs/_static and removed logic for conditionally including it only in pages with console tabs. That depended on custom handling in the djangodocs theme layout.html template, which isn't portable to other themes. * Switched console tabs from Font Awesome brand icons to text and removed the vendored fa-brands fonts (to avoid moving them from the djangodocs theme to the docs/_static dir). * Ensured both console tabs include a wrapper div around literal code blocks: `<div class="highlight-{lexer} notranslate">` (where lexer is `console` for Unix and `doscon` for Windows). This wrapper had been missing for the Windows content, which could cause shifting layouts when changing tabs with third-party Sphinx themes (and may have interfered with browser translation tools). Fixed by rendering the Windows tab with a temporary literal block, matching how the Unix tab is rendered. Removed direct call to the Pygments highlighter. The Windows tab is no longer force-highlighted, so a doscon lexing failure now reports a warning rather than being silently ignored. * Removed custom `VersionDirective` and HTML writer overrides for `visit_versionmodified()` and `depart_versionmodified()`. Sphinx's standard changeset directives are now used. (Refs #20104.) The original code was meant to substitute "development version" for conf.py `django_next_version` and to refer to "Django N.M" rather than the generic "version N.M" in changeset messages. But it missed the `deprecated` directive and aliases like `version-modified` added in Sphinx 9.0, didn't apply to non-HTML output formats, and generated inconsistent HTML that wasn't compatible with standard Sphinx themes. Related cleanup: * Updated documentation on using versionadded and versionchanged directives to accurately reflect Sphinx's rendered text, and removed the policy bullet describing the old Django-specific phrasing. * Enabled biome for all css and js files in docs (except in docs/_build). * Consistently excluded all non-docs source dirs and requirements.txt from searches for *.txt source files in conf.py exclude_patterns, make.bat, Makefile, and lint.py. Refs #35874, #37138, #20104.
2026-09-07Refs #37127 -- Added a version-aware sourcefile Sphinx role.rshide
Co-authored-by: Tim Schilling <schillingt@better-simple.com>
2026-07-06Fixed #37204 -- Rendered console directives as plain code in epub docs builds.Natalia
The console directive renders its Unix/Windows tabs with browser-only markup: hidden radio inputs toggled via CSS. The epub builder shares the HTML format, so it copied that markup into the ebook, where the tabs cannot work (e-readers do not support the driving CSS) and the raw HTML is not well-formed XHTML, so strict readers fail to parse the page. Skipped the tab markup for the epub builder and fell back to a plain literal block, matching what the non-HTML builders already do.
2026-06-09Removed obsolete Sphinx < 1.8 fallback in `VersionDirective` from djangodocs ↵Natalia
extension.
2026-06-09Fixed #37150 -- Made djangodocs Sphinx extension work with any html builder.Mike Edmunds
Changed djangodocs extension to register DjangoHTMLTranslator for any html-format builder (in the builder-inited hook), rather than a limited list of builders at startup. That fixes missing content in dirhtml and standard html builds (including ReadTheDocs PR previews): - Missing console tabs - Empty divs for versionadded and versionchanged directives Removed JS code that depended on jQuery, which hasn't worked since Sphinx 6.0 dropped jQuery in 2023: - Unnecessary console tabs click handling. (Console tab behavior is implemented purely in CSS.) - Client-side hyperlinking of Django template tags and filters in code examples. (This is also not supported on docs.djangoproject.com.) Removed custom DjangoStandaloneHTMLBuilder and "djangohtml" builder type. Its sole purpose was to generate the "templatebuiltins.js" file used for the (non-functional) client-side template filter/tag linking. Changed docs "make html" target from "djangohtml" to standard "html".
2026-01-18Applied Black's 2026 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/26.1.0
2024-07-01Fixed typo in source file linking Sphinx extension.Michael
2024-05-21Refs #29942 -- Fixed docs build on Python < 3.9 avoiding dict union operator.David Smith
The docs build process was failing on djangoproject.com since it uses Python 3.8 and the dict union operator was added in Python 3.9.
2024-05-14Fixed #29942 -- Restored source file linking in docs by using the Sphinx ↵Joachim Jablon
linkcode ext. Co-authored-by: David Smith <smithdc@gmail.com> Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2023-08-03Fixed #34756 -- Fixed docs HTML build on Sphinx 7.1+.David Smith
2023-05-04Removed unnecessary workarounds for Sphinx < 4.3.0.Sarah Boyce
Unnecessary since ebf25555bbed3e9112d4b726575d60b242daf48a.
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-11-17Fixed crash building HTML docs since Sphinx 4.3.Mariusz Felisiak
See https://github.com/sphinx-doc/sphinx/commit/dd2ff3e911c751c06c81f494128fba56d8ecbafd.
2021-08-02Refs #32956 -- Corrected spelling of "gray".David Smith
2020-06-03Made default_role_error use logger.Mariusz Felisiak
This prevents raising errors for translated docs, see https://github.com/django/djangoproject.com/issues/997 Follow up to 1cdfe8d91215eefaa18c398069dd9c6879a9511d.
2020-05-04Changed `'%s' % value` pattern to `str(value)`.Nick Pope
2020-04-14Sorted imports in docs/_ext/djangodocs.py.Tim Graham
2020-04-07Fixed CodeBlock deprecation warning on Sphinx 2.1+.Mariusz Felisiak
2020-04-01Prevented (and corrected) single backtick usage in docs.Adam Johnson
2019-11-25Fixed #31025 -- Fixed highlightlinenothreshold deprecation warning on Sphinx ↵Baptiste Mispelon
1.8+.
2019-11-21Made versionadded/versionchanged annotations without a content end with ".".Sergey Fedoseev
Regression in d2afa5eb2308e672b6313876856e32e2561b90f3.
2018-10-01Fixed crash building translated docs since Sphinx 1.8.Tim Graham
2018-09-19Updated contributing tutorial's virtual environment instructions.Thomas Grainger
2018-09-11Fixed env.note_versionchange() deprecation warning in Sphinx 1.8.Tim Graham
2018-09-10Removed usage of deprecated sphinx APIs.Tim Graham
2018-09-10Refs #20910 -- Replaced snippet directive with code-block.Curtis Maloney
2018-08-27Replaced CVE/ticket roles with extlinks.Tim Graham
2018-03-22Bumped minimum Sphinx version to 1.6.0.Tim Graham
2018-03-07Used console directive in "Writing documentation".Roy Zwambag
2018-01-20Fixed #28343 -- Add an OS chooser for docs command line examples.Ramiro Morales
2017-12-04Fixed #28860 -- Removed unnecessary len() calls.Дилян Палаузов
2017-06-01Refs #23968 -- Removed unnecessary lists, generators, and tuple calls.Jon Dufresne
2017-05-24Removed usage of deprecated sphinx.util.compat.Directive.Tim Graham
2017-05-24Fixed docs build with Sphinx 1.6.Dmitry Shachnev
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super() in docs.chillaranand
2016-12-14Fixed missing versionadded/changed annotations on docs.djangoproject.com.Tim Graham
Fixed a regression in bacdfbf3d1eb23ff8e8110681728a5b467443446.
2016-12-05Removed deprecated html_translator_class sphinx config option.Tim Graham
2016-11-14Fixed #27463 -- Fixed E741 flake8 warnings.Ramin Farajpour Cami
2016-09-26Added a CVE role for Sphinx.Tim Graham
2016-07-06Added copy-to-clipboard support for all code snippetsBaptiste Mispelon
2016-01-14Fixed #23868 -- Added support for non-unique django-admin-options in docs.Tim Graham
Also documented missing short command line options to fix #24134. This bumps the minimum sphinx version required to build the docs to 1.3.4. Thanks Simon Charette for review.
2016-01-13Removed unused docs/_ext/applyxrefs.pyTim Graham
2016-01-13Declared Sphinx extensions safe for parallel reading.Tim Graham
2015-11-16Removed a docs workaround for an old Sphinx version.Tim Graham