Opened 6 months ago

Last modified 6 months ago

#36304 assigned Cleanup/optimization

Classes functions (etc) should have a header in the documentation — at Version 1

Reported by: Sarah Boyce Owned by:
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 (1)

comment:1 by Natalia Bidart, 6 months ago

Description: modified (diff)
Triage Stage: UnreviewedAccepted

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

Note: See TracTickets for help on using tickets.
Back to Top