diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2025-07-02 14:53:49 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2025-07-02 17:09:25 -0400 |
| commit | f8ab8a87a2ce514875098667a3cd4b01279a2ed2 (patch) | |
| tree | f179de51872910844320251cb99128e9091dd4a6 /api-docs/source | |
| parent | 90a1adc7029618e2cffde522c8b8a88aad4769b4 (diff) | |
improve summary splits to prevent a doc warning
Diffstat (limited to 'api-docs/source')
| -rw-r--r-- | api-docs/source/conf.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/api-docs/source/conf.py b/api-docs/source/conf.py index c96acd63..0e205d9f 100644 --- a/api-docs/source/conf.py +++ b/api-docs/source/conf.py @@ -174,7 +174,19 @@ Full Class List if first_line and not first_line.startswith(classname + "("): summary = first_line if len(summary) > 100: - summary = summary[:97] + "..." + # Find a good break point to avoid cutting off Sphinx directives + truncate_at = 97 + # Look for space before truncation to avoid breaking words + if ' ' in summary[80:97]: + space_pos = summary.rfind(' ', 80, 97) + if space_pos > 80: + truncate_at = space_pos + # Check if we're in the middle of a Sphinx directive + if ':py:' in summary[truncate_at-10:truncate_at+10]: + directive_start = summary.rfind(':py:', 0, truncate_at) + if directive_start != -1: + truncate_at = directive_start + summary = summary[:truncate_at] + "..." modulefile.write(f" * - :{role}:`{inspect.getmodule(classref).__name__}.{classname}`\n") modulefile.write(f" - {summary}\n") |
