Skip to content

WIP: Update models docstrings to follow proper RST conventions#583

Draft
ormsbee wants to merge 2 commits intoopenedx:mainfrom
ormsbee:docstrings-fix-3
Draft

WIP: Update models docstrings to follow proper RST conventions#583
ormsbee wants to merge 2 commits intoopenedx:mainfrom
ormsbee:docstrings-fix-3

Conversation

@ormsbee
Copy link
Copy Markdown
Contributor

@ormsbee ormsbee commented May 5, 2026

This reformats a lot of our docstrings to follow RST practices properly, like real links to classes and models, fixing some Markdown-isms, reformatting broken definition lists, etc. The thing that makes me twitch the most is reformatting large block-comments over variable declarations to be docstring-like comments under them.

There are still presentation issues that are really awkward:

  1. The model fields are rewritten as both params and as attributes).
  2. The headers are awkwardly large.

I manually mucked around with the config a bit to see if I could get it looking better.

Also, I noticed while skimming the diff that a chunk of the docs are factually out-of-date, e.g. some of the Collection stuff. Fixing those things is beyond the scope of this PR.

To test locally, run make docs at the root. You may need to install the requirements/doc.txt requirements.

The Claude prompt:

The openedx_content app has extensive docstrings in its models files, but those doscstrings often do not conform to good RST conventions. Sometimes Markdown formatting is used instead of RST. Class names and function names are not properly linked. Some annotations may be incorrect or inconsistently applied. Definition lists are sometimes spaced wrong, so they end up looking like blockquotes. Definition lists are sometimes defined with (illegal) multi-line terms, and this should be reformatted. Model fields are sometimes commented extensively in comments that go above the field declarations, instead of docstring comments below the fields (which would get picked up by Sphinx). State transitions are sometimes written as "->" instead of "→", leading to a poorer reading experience in rendered HTML documentation.

Create a plan to fix these issues, and any other formatting errors you find. Reflow lines as necessary to keep within an 80 character line limit (if possible). Do not change the actual content of these comments.

@ormsbee ormsbee changed the title Update models docstrings to follow proper RST conventions WIP: Update models docstrings to follow proper RST conventions May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant