rails / sdoc

Standalone sdoc generator
http://api.rubyonrails.org/
Other
823 stars 131 forks source link

Skip rendering empty descriptions #355

Closed jonathanhefner closed 6 months ago

jonathanhefner commented 6 months ago

RDoc::CodeObject#comment appears to always return a string, even if no comment has been specified. Thus the truthiness of comment cannot be used to skip rendering empty descriptions.

This commit adds a description_for helper to encapsulate properly checking comment and wrapping the rendered description in a div.

This commit also renames the full_name and short_name helpers to full_name_for and short_name_for to match description_for.