Skip to content

Commit

Permalink
Fix section comments in darkfish
Browse files Browse the repository at this point in the history
This is almost certainly the wrong way to do this.  But the lack of
section comments has been bugging me for years, and this was my first
attempt at figuring out why it is broken.  Maybe someone else can fix it
The Right Way, or give me some advice on how to do so myself...
  • Loading branch information
nevans committed Nov 28, 2022
1 parent fb28c2f commit 3c2ad0a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/rdoc/context/section.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def marshal_load array
# Parses +comment_location+ into an RDoc::Markup::Document composed of
# multiple RDoc::Markup::Documents with their file set.

def parse
def parse _comment_location
case @comments
when String then
super
Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/generator/markup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def as_href(from_path)
# Handy wrapper for marking up this object's comment

def description
markup @comment
markup @comment || @comments&.first
end

##
Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/generator/template/darkfish/class.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</header>
<%- end -%>
<%- if section.comment then -%>
<%- if section.comment || section.comments.any? then -%>
<div>
<%= section.description %>
</div>
Expand Down
1 change: 1 addition & 0 deletions lib/rdoc/text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def flush_left text
# Requires the including class to implement #formatter

def markup text
@store ||= @parent&.store
if @store.rdoc.options
locale = @store.rdoc.options.locale
else
Expand Down

0 comments on commit 3c2ad0a

Please sign in to comment.