docs: fix RST double-backtick notation breaking API cross-reference links#658
Conversation
…inks RST-style ``Symbol`` in docstrings caused add_cross_references to generate malformed link syntax: `[`Symbol`](url)` renders as inline code rather than a clickable link in Mintlify. - Add normalize_rst_backticks() pass in decorate_api_mdx.py (runs before add_cross_references) to convert ``x`` to `x` in MDX prose - Add validate_rst_docstrings() in validate.py to scan source files and report occurrences as a warning (does not fail the build) 91 source files / 992 occurrences detected; fix is applied at build time. Source cleanup tracked separately.
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
|
need to decide if we want to merge this one or #659 |
|
I'm looking at the other PR which is indeed appropriate to fix. There's 2 issues currently - short term/proper fix - this was to avoid risk/approval and get broken doc fixed quickly since we published it a few hours ago. I would recommend we merge this issue in any case - it's not inconsistent in any way, and also adds a validation check for bad links. This is currently a soft check so after merge will report the RST issues. Then if we merge #659 we'll see that validation drop by 0 We already have an issue open to move soft fail to hard fail in #f616 (this should include seeing if any parts can be replaced/augmented by ruff checks) The benefit #659 brings is it's another step completed quickly :-) So I see a progression here.. we get better step by step :-) |
|
Minor: |
|
re: above -- docstring fixed |
98c0e22
docs: fix RST double-backtick notation breaking API cross-reference links
Type of PR
Description
API doc pages were displaying cross-references as raw markdown text rather than clickable links. For example, on
mellea.backends.backend, the class description rendered as:— the link syntax appeared as inline code rather than a hyperlink.
Root cause: 91 source files use RST-style ``Symbol`` double-backtick notation (Sphinx convention). The
add_cross_referencesbuild step matched the inner backtick boundary and generated a link wrapped in an extra code span:Fix: A new
normalize_rst_backticks()pass indecorate_api_mdx.pyconverts ``x`` → `x` in MDX prose beforeadd_cross_referencesruns. A newvalidate_rst_docstrings()check invalidate.pydetects remaining occurrences and reports them as a build warning (does not fail the build).The 992 occurrences across 91 source files are tracked for cleanup in #657.
CI validation output after this fix:
Testing