#36753: Django docs GitHub source links use incorrect line numbers for version
branches
-------------------------------------+-------------------------------------
     Reporter:  Youngkwang Yang      |                     Type:  Bug
       Status:  new                  |                Component:
                                     |  Documentation
      Version:  dev                  |                 Severity:  Normal
     Keywords:  documentation,       |             Triage Stage:
  function link                      |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 Django documentation uses Sphinx's `.. function::` directive to generate
 source code links.
 while these links correctly point to version-specific branches (e.g.,
 `stable/5.2.x`),
 the line numbers are calculated from the `main` branch, not the documented
 version.

 == reproduce:
 1. visit Django 5.2 documentation:
 
https://docs.djangoproject.com/en/5.2/ref/models/instances/#django.db.models.Model
 2. click the "**[source]"** link
 3. note the line number in the URL

 == current behavior:
 the source link might be:
 
(https://github.com/django/django/blob/stable/5.2.x/django/db/models/base.py#L498)

 but in the stable/5.2.x branch, the function is actually at line **461**,
 not **498**.

 == expect behavior:
 line number should match the actual location in the version-specific
 branch (e.g., L461 for stable/5.2.x).

 the issue appears to be related to how line numbers are calculated during
 the documentation build process.
 relevant code is in
 https://github.com/django/django/blob/main/docs/_ext/github_links.py#L78:
 the links still work, but the inaccurate line numbers can be confusing.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36753>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019ab1c070c0-13d02033-5c0a-43b6-af27-efdf30f7b0db-000000%40eu-central-1.amazonses.com.

Reply via email to