Skip to content

docs: fix RST rendering of code blocks in toeplitz docstrings (#198)#285

Open
r1cksync wants to merge 1 commit into
google-deepmind:mainfrom
r1cksync:fix-toeplitz-docstring-rst
Open

docs: fix RST rendering of code blocks in toeplitz docstrings (#198)#285
r1cksync wants to merge 1 commit into
google-deepmind:mainfrom
r1cksync:fix-toeplitz-docstring-rst

Conversation

@r1cksync

Copy link
Copy Markdown
Contributor

What

Addresses part of #198 (RTD formatting — item 1, "Code is not being formatted properly"). The matrix_factorization.toeplitz docstrings for materialize_lower_triangular and solve_banded wrap their example ASCII matrices in Markdown ``` fences. Docstrings are rendered as reStructuredText (Sphinx + napoleon), where triple backticks are not code-block syntax, so the matrices render with literal backtick characters and get reflowed instead of shown as a monospace block (visible on the solve_banded RTD page cited in the issue).

Fix

Convert the two fenced blocks to RST literal blocks (end the lead-in line with :: and indent the matrix), and mark the inline coef/n/rhs examples as inline literals (``).

Verification

Rendered both (dedented) docstrings through docutils: each now produces exactly one literal_block node (the matrix) plus inline literal nodes, with no warnings introduced by the change.

Per the issue ("Incremental changes to fix these up will be good"), this is scoped to the two cited functions; happy to follow up on the other sub-items (type-alias rendering, overview links) separately.

The materialize_lower_triangular and solve_banded docstrings wrapped their
example ASCII matrices in Markdown triple-backtick fences. Sphinx/napoleon
render docstrings as reStructuredText, where triple backticks are not a
code-block syntax, so the matrices showed up with literal backtick characters
and were reflowed instead of displayed as monospace blocks (issue google-deepmind#198).

Convert them to RST literal blocks (a trailing "::" plus an indented block) and
mark the inline `coef`/`n`/`rhs` examples as inline literals.
@github-actions

Copy link
Copy Markdown

This PR has been idle for 7 days. Please provide an update or review.

@github-actions github-actions Bot added the Stale label Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant