Skip to content

Update models docstrings to follow proper RST conventions#583

Open
ormsbee wants to merge 1 commit into
openedx:mainfrom
ormsbee:docstrings-fix-3
Open

Update models docstrings to follow proper RST conventions#583
ormsbee wants to merge 1 commit into
openedx: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.

This doesn't fix everything, but it rehabilitates the docs to a place that is much better than where we started. This did not add any new content to the docs—it's just reformatting and some rephrasing on my part as part of some manual edits. I've deleted a few outdated TODO items, but I've otherwise refrained from trying to do any additional editing to the docstrings for now, in the hopes of landing this more easily.

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
@ormsbee ormsbee marked this pull request as ready for review May 24, 2026 01:49
@ormsbee ormsbee force-pushed the docstrings-fix-3 branch from 554a109 to 45a4391 Compare May 24, 2026 01:56
@ormsbee ormsbee changed the title WIP: Update models docstrings to follow proper RST conventions Update models docstrings to follow proper RST conventions May 24, 2026
This fixes a lot of formatting, including things like improperly
specified lists, Markdown formatting conventions, and many missing
module and class references.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ormsbee ormsbee force-pushed the docstrings-fix-3 branch from 45a4391 to ad771fb Compare May 24, 2026 01:59
@ormsbee
Copy link
Copy Markdown
Contributor Author

ormsbee commented May 24, 2026

@sarina, @kdmccormick: This PR is ready for review. I had to make a few minor edits after Claude went through it, and I modified some comments to remove outdated TODOs. Otherwise, it's all just reformatting as described in the prompt.

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