Opened 60 minutes ago
#37251 new Cleanup/optimization
Document Incomplete substitution rendering of inline `|version|` placeholder in tutorial01.txt
| Reported by: | Vainl | Owned by: | |
|---|---|---|---|
| Component: | Uncategorized | Version: | 6.0 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Section The development server at File: docs/intro/tutorial01.txt
The raw string in the source text:
For more information on production servers see: https://docs.djangoproject.com/en/|version|/howto/deployment/
Compiles into HTML as:
For more information on production servers see: <a class="reference external" href="https://docs.djangoproject.com/en/">https://docs.djangoproject.com/en/</a>6.2/howto/deployment/
The |version| tag breaks the link.
The following change fixes the issue, but it still hardcodes the language to en. There might be a better way to implement this dynamically.
diff --git a/docs/conf.py b/docs/conf.py
index 864b9f7..e32e6f9 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -146,6 +146,7 @@ extlinks = {
# A file or directory. GitHub redirects from blob to tree if needed.
"source": ("https://github.com/django/django/blob/main/%s", "%s"),
"ticket": ("https://code.djangoproject.com/ticket/%s", "#%s"),
+ "djlink": (f"https://djangoproject.com/en/{version}/%s", None),
}
if sphinx_version < (8, 1):
diff --git a/docs/intro/tutorial01.txt b/docs/intro/tutorial01.txt
index db6150a..643ba44 100644
--- a/docs/intro/tutorial01.txt
+++ b/docs/intro/tutorial01.txt
@@ -131,7 +131,7 @@ You'll see the following output on the command line:
Quit the server with CONTROL-C.
WARNING: This is a development server. Do not use it in a production setting. Use a production WSGI or ASGI server instead.
- For more information on production servers see: https://docs.djangoproject.com/en/|version|/howto/deployment/
+ For more information on production servers see: :djlink:`howto/deployment/`
.. note::
Ignore the warning about unapplied database migrations for now; we'll deal