File tree Expand file tree Collapse file tree 4 files changed +23
-25
lines changed
generator/template/rorvswild Expand file tree Collapse file tree 4 files changed +23
-25
lines changed Original file line number Diff line number Diff line change 82
82
gsub ( /^\w +\. /m , '' ) ) .
83
83
gsub ( /(.*)[-=]>/ , '\1→' ) %>
84
84
</ span >
85
- <%- if i == 0 and method . token_stream then -%>
86
- < span class ="method-click-advice "> toggle source</ span >
87
- <%- end -%>
88
85
</ div >
89
86
<%- end -%>
90
87
<%- elsif method . has_call_seq? then -%>
93
90
</ div >
94
91
<%- else -%>
95
92
< div class ="method-heading ">
96
- < span class ="method-name "> <%= h method . name %> </ span > < span
97
- class ="method-args "> <%= h method . param_seq %> </ span >
98
- <%- if method . token_stream then -%>
99
- < span class ="method-click-advice "> toggle source</ span >
100
- <%- end -%>
93
+ < span class ="method-name "> <%= h method . name %> </ span >
94
+ < span class ="method-args "> <%= h method . param_seq %> </ span >
101
95
</ div >
102
96
<%- end -%>
103
97
</ div >
115
109
</ div >
116
110
<%- end -%>
117
111
<%- if method . token_stream then -%>
112
+ < button class ="toggle-source "> toggle source</ button >
118
113
< div class ="method-source-code " id ="<%= method . html_name %> -source ">
119
114
< pre > <%= method . markup_code %> </ pre >
120
115
</ div >
Original file line number Diff line number Diff line change @@ -208,14 +208,15 @@ details > summary::after {
208
208
content : '+' ;
209
209
font-size : 0.833em ;
210
210
font-weight : bold;
211
- width : 22 px ;
212
- height : 22 px ;
213
- line-height : 20 px ;
211
+ width : 2 em ;
212
+ height : 2 em ;
213
+ line-height : 2 em ;
214
214
border-radius : 50% ;
215
215
text-align : center;
216
216
box-shadow : 0 0 0 1px var (--color-border ) inset;
217
217
transition : transform 0.2s ease;
218
218
display : inline-block;
219
+ flex-shrink : 0 ;
219
220
cursor : pointer;
220
221
position : relative;
221
222
top : 2px ;
@@ -707,26 +708,29 @@ em {
707
708
font-size : 1rem ;
708
709
font-weight : bold;
709
710
color : var (--color-text );
710
- cursor : pointer;
711
711
}
712
712
713
713
.method-heading span { background-color : var (--color-code-background ); }
714
714
715
715
.method-heading : any-link { color : inherit; }
716
716
717
- .method-heading .method-click-advice {
718
- background-color : transparent;
719
- position : absolute;
720
- color : var (--color-text-light );
721
- right : 0 ;
722
- font-size : 0.694rem ;
717
+ .toggle-source {
718
+ margin-top : 0.5rem ;
719
+ font-size : 0.833rem ;
723
720
font-weight : 400 ;
724
- visibility : hidden;
725
- padding-right : 0 ;
726
- line-height : 1.5rem ;
721
+ line-height : 1rem ;
722
+ background : var (--color-code-background );
723
+ box-shadow : 0 0 0 1px var (--color-border );
724
+ color : var (--color-text );
725
+ border-radius : 2px ;
726
+ border : none;
727
+ cursor : pointer;
727
728
}
728
729
729
- .method-header : hover .method-click-advice { visibility : visible; }
730
+ .toggle-source : hover {
731
+ box-shadow : 0 0 0 1px var (--color-text-light );
732
+ color : var (--color-title );
733
+ }
730
734
731
735
.method-description ,
732
736
.aliases {
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ function showSource( e ) {
34
34
} ;
35
35
36
36
function hookSourceViews ( ) {
37
- document . querySelectorAll ( '.method-heading ' ) . forEach ( function ( codeObject ) {
37
+ document . querySelectorAll ( '.toggle-source ' ) . forEach ( function ( codeObject ) {
38
38
codeObject . addEventListener ( 'click' , showSource ) ;
39
39
} ) ;
40
40
} ;
Original file line number Diff line number Diff line change @@ -308,8 +308,7 @@ def accept_heading heading
308
308
end
309
309
@res << to_html ( heading . text )
310
310
unless @options . pipe then
311
- @res << "<span><a href=\" ##{ label } \" >¶</a>"
312
- @res << " <a href=\" #top\" >↑</a></span>"
311
+ @res << "<span><a href=\" ##{ label } \" >¶</a></span>"
313
312
end
314
313
@res << "</h#{ level } >\n "
315
314
end
You can’t perform that action at this time.
0 commit comments