File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed
rdoc/generator/template/rails/resources/css Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -772,6 +772,11 @@ html {
772
772
white-space : pre-wrap;
773
773
}
774
774
775
+ .method__signature code .returns {
776
+ font-family : var (--body-font );
777
+ font-size : 1.1em ;
778
+ }
779
+
775
780
.target .method__signature code ::before {
776
781
content : " " ;
777
782
Original file line number Diff line number Diff line change @@ -207,14 +207,16 @@ def module_methods(rdoc_module)
207
207
end
208
208
209
209
def method_signature ( rdoc_method )
210
- if rdoc_method . call_seq
210
+ signature = if rdoc_method . call_seq
211
211
# Support specifying a call-seq like `to_s -> string`
212
212
rdoc_method . call_seq . gsub ( /^\s *([^(\s ]+)(.*?)(?: -> (.+))?$/ ) do
213
- "<code>< b>#{ h $1} </b>#{ h $2} </code> #{ " → <code> #{ h $3} </code> " if $3} "
213
+ "<b>#{ h $1} </b>#{ h $2} #{ " <span class= \" returns \" > →</span> #{ h $3} " if $3} "
214
214
end
215
215
else
216
- "<code>< b>#{ h rdoc_method . name } </b>#{ h rdoc_method . params } </code> "
216
+ "<b>#{ h rdoc_method . name } </b>#{ h rdoc_method . params } "
217
217
end
218
+
219
+ "<code>#{ signature } </code>"
218
220
end
219
221
220
222
def method_source_code_and_url ( rdoc_method )
Original file line number Diff line number Diff line change @@ -813,13 +813,13 @@ def qux(&block); end
813
813
RUBY
814
814
815
815
_ ( @helpers . method_signature ( mod . find_method ( "bar" , false ) ) ) . must_equal <<~HTML . chomp
816
- < code > < b > bar</ b > (op = :<)</ code >
817
- < code > < b > bar</ b > (&block)</ code >
816
+ < code > < b > bar</ b > (op = :<)
817
+ < b > bar</ b > (&block)</ code >
818
818
HTML
819
819
820
820
_ ( @helpers . method_signature ( mod . find_method ( "qux" , false ) ) ) . must_equal <<~HTML . chomp
821
- < code > < b > qux</ b > (&block)</ code > → < code > self </ code >
822
- < code > < b > qux</ b > </ code > → < code > Enumerator</ code >
821
+ < code > < b > qux</ b > (&block) < span class =" returns " > →</ span > self
822
+ < b > qux</ b > < span class =" returns " > →</ span > Enumerator</ code >
823
823
HTML
824
824
end
825
825
end
You can’t perform that action at this time.
0 commit comments