Opened 3 months ago

Last modified 3 months ago

#36304 assigned Cleanup/optimization

Classes functions (etc) should have a header in the documentation

Reported by: Sarah Boyce Owned by: Ahmed Nassar
Component: Documentation Version: 5.2
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by Natalia Bidart)

Currently, the docs are slightly inconsistent whether classes/functions have their own header or not.
For example:

Following a conversation on the forum, being generous with headers is preferable because:

  • it improves the table of contents to make it easier to navigate the page for all users
  • the page is more accessible to screen reader users as they can navigate via headers
  • (minor) the djangoproject.com docs search checks the table of contents when ranking search results (so adding headers improves the search results)

The discussion is here: https://forum.djangoproject.com/t/set-toc-object-entries-true-to-auto-add-functions-classes-to-the-pages-table-of-contents/38902/7

I propose we update our documentation guide to include adding a "duplicate" header above class or function definitions: https://docs.djangoproject.com/en/5.2/internals/contributing/writing-documentation/#guidelines-for-restructuredtext-files

Change History (8)

comment:1 by Natalia Bidart, 3 months ago

Description: modified (diff)
Triage Stage: UnreviewedAccepted

I think this makes sense and it aligns with the conversation in the forum post.

comment:2 by Ahmed Nassar, 3 months ago

Owner: set to Ahmed Nassar
Status: newassigned

comment:3 by Ahmed Nassar, 3 months ago

Has patch: set

comment:4 by Mariusz Felisiak, 3 months ago

Patch needs improvement: set

comment:5 by Ahmed Nassar, 3 months ago

Patch needs improvement: unset

comment:6 by Andrew Northall, 3 months ago

Patch needs improvement: set

comment:7 by Ahmed Nassar, 3 months ago

Patch needs improvement: unset

comment:8 by Andrew Northall, 3 months ago

Patch needs improvement: set
Note: See TracTickets for help on using tickets.
Back to Top