[Docs] Add source code blocks for methods#1229
Conversation
Signed-off-by: SumanthRH <sumanthrh99@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request refactors the documentation generation script to add source code blocks for methods, not just top-level classes and functions. The changes are well-structured, breaking down the logic into smaller helper functions and using a two-pass approach to inject the source code into the generated Markdown. This is a great improvement. My feedback focuses on improving error handling by replacing broad except Exception clauses with more specific exception types, which will make the code more robust and easier to debug.
| except Exception: | ||
| return md | ||
| return None, None, None |
There was a problem hiding this comment.
| except Exception: | ||
| return None, None, None |
There was a problem hiding this comment.
| except Exception: | ||
| continue |
There was a problem hiding this comment.
To avoid hiding potential bugs, it's best to catch specific exceptions instead of a general Exception. Here, AttributeError would be more suitable if a member object is missing expected attributes like kind, lineno, or endlineno.
| except Exception: | |
| continue | |
| except AttributeError: | |
| continue |
What does this PR do?
Adds source code blocks for methods. Currently, source code blocks are shown only for classes.