diff options
author | nick evans <[email protected]> | 2022-11-16 14:11:08 -0500 |
---|---|---|
committer | git <[email protected]> | 2022-11-27 17:24:17 +0000 |
commit | 29862ce27303107935de6df4f85dd7fd610f19e2 (patch) | |
tree | f2b55942ed6bdb8133fb78dff1dcd2d56abc3d80 /lib/rdoc/generator | |
parent | ae3817bc61cb320524f153e82eb5eee752188a12 (diff) |
[ruby/rdoc] Darkfish: group method call-seq in div.method-header
This way, custom CSS styles can be easily applied to the entire method
header at once. Otherwise, it can be tricky to make a border that goes
around the entire set of method call-seq, but not the method
description.
https://github.com/ruby/rdoc/commit/5db4bce01e
Diffstat (limited to 'lib/rdoc/generator')
-rw-r--r-- | lib/rdoc/generator/template/darkfish/class.rhtml | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/lib/rdoc/generator/template/darkfish/class.rhtml b/lib/rdoc/generator/template/darkfish/class.rhtml index 5d7b6a1b80..97d175dddc 100644 --- a/lib/rdoc/generator/template/darkfish/class.rhtml +++ b/lib/rdoc/generator/template/darkfish/class.rhtml @@ -98,28 +98,30 @@ <%- methods.each do |method| -%> <div id="<%= method.aref %>" class="method-detail <%= method.is_alias_for ? "method-alias" : '' %>"> - <%- if (call_seq = method.call_seq) then -%> - <%- call_seq.strip.split("\n").each_with_index do |call_seq, i| -%> - <div class="method-heading"> - <span class="method-callseq"> - <%= h(call_seq.strip. - gsub( /^\w+\./m, '')). - gsub(/(.*)[-=]>/, '\1→') %> - </span> - <%- if i == 0 and method.token_stream then -%> - <span class="method-click-advice">click to toggle source</span> - <%- end -%> - </div> - <%- end -%> - <%- else -%> - <div class="method-heading"> - <span class="method-name"><%= h method.name %></span><span - class="method-args"><%= h method.param_seq %></span> - <%- if method.token_stream then -%> - <span class="method-click-advice">click to toggle source</span> + <div class="method-header"> + <%- if (call_seq = method.call_seq) then -%> + <%- call_seq.strip.split("\n").each_with_index do |call_seq, i| -%> + <div class="method-heading"> + <span class="method-callseq"> + <%= h(call_seq.strip. + gsub( /^\w+\./m, '')). + gsub(/(.*)[-=]>/, '\1→') %> + </span> + <%- if i == 0 and method.token_stream then -%> + <span class="method-click-advice">click to toggle source</span> + <%- end -%> + </div> + <%- end -%> + <%- else -%> + <div class="method-heading"> + <span class="method-name"><%= h method.name %></span><span + class="method-args"><%= h method.param_seq %></span> + <%- if method.token_stream then -%> + <span class="method-click-advice">click to toggle source</span> + <%- end -%> + </div> <%- end -%> </div> - <%- end -%> <div class="method-description"> <%- if method.comment then -%> |