-
-
Notifications
You must be signed in to change notification settings - Fork 31
Add support for @par with title #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add support for @par with title #143
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideIntroduces parsing of optional paragraph titles for Doxygen’s @Par by detecting a <title> element and rendering its text as the section header while preserving the existing label fallback. Sequence diagram for parsing @Par with optional titlesequenceDiagram
participant "xml_parser.paras()"
participant "Element <simplesect>"
participant "Element <title>"
participant "MdBold"
participant "Text"
"xml_parser.paras()"->>"Element <simplesect>": check for <title>
alt title exists and has text
"xml_parser.paras()"->>"Element <title>": get title text
"xml_parser.paras()"->>"MdBold": create bold section header with title
else kind in SIMPLE_SECTIONS
"xml_parser.paras()"->>"MdBold": create bold section header with fallback label
"xml_parser.paras()"->>"Text": get label from SIMPLE_SECTIONS
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `mkdoxy/xml_parser.py:251-255` </location>
<code_context>
kind = item.get("kind")
- ret.extend((Br(), MdBold([Text(SIMPLE_SECTIONS[kind])])))
+ title = item.find("title")
+ if title is not None and title.text:
+ ret.extend((Br(), MdBold(self.paras(title)), Br()))
+ elif kind in SIMPLE_SECTIONS:
+ ret.extend((Br(), MdBold([Text(SIMPLE_SECTIONS[kind])])))
</code_context>
<issue_to_address>
**suggestion:** Check for empty or whitespace-only title text.
The current logic does not handle titles that contain only whitespace. Use title.text.strip() to check for non-empty titles before rendering.
```suggestion
title = item.find("title")
if title is not None and title.text and title.text.strip():
ret.extend((Br(), MdBold(self.paras(title)), Br()))
elif kind in SIMPLE_SECTIONS:
ret.extend((Br(), MdBold([Text(SIMPLE_SECTIONS[kind])])))
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Related to #86 |
Change Summary
I wanted to see paragraph sections with custom titles like "Example:" or "Tip:", but the parser was ignoring Doxygen's optional paragraph title.
Sample usage
Paragraph without title (pre-existing functionality)
Paragraph with title
Summary by Sourcery
New Features: