File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
lib/rdoc/generator/template/darkfish Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 4
4
< h3 > Pages</ h3 >
5
5
6
6
< ul class ="link-list ">
7
- <%- simple_files . each do |f | -%>
7
+ <%- simple_files . group_by do |f | -%>
8
+ <%- f . full_name [ %r{\A [^/]+(?=/)} ] || f . page_name -%>
9
+ <%- end . each do |n , files | -%>
10
+ <%- f = files . shift -%>
11
+ <%- if files . empty? -%>
8
12
< li > < a href ="<%= rel_prefix %> / <%= f . path %> "> <%= h f . page_name %> </ a >
13
+ <%- next -%>
14
+ <%- end -%>
15
+ < li > < details > < summary > <%
16
+ if n == f . page_name
17
+ %> < a href ="<%= rel_prefix %> / <%= f . path %> "> <%= h n %> </ a > <%
18
+ else
19
+ %> <%= h n %> <% files . unshift ( f )
20
+ end %> </ summary >
21
+ < ul class ="link-list ">
22
+ <%- files . each do |f | -%>
23
+ < li > < a href ="<%= rel_prefix %> / <%= f . path %> "> <%= h f . page_name %> </ a >
24
+ <%- end -%>
25
+ </ ul > </ details >
9
26
<%- end -%>
10
27
</ ul >
11
28
</ div >
Original file line number Diff line number Diff line change @@ -105,6 +105,11 @@ def test_generate_page
105
105
@g . generate
106
106
assert_file 'outer_rdoc.html'
107
107
assert_file 'outer/inner_rdoc.html'
108
+ index = File . read ( 'index.html' )
109
+ re = %r[<summary><a href="\. /outer_rdoc\. html">outer</a></summary>.*?</details>]m
110
+ assert_match ( re , index )
111
+ summary = index [ re ]
112
+ assert_match %r[<a href="\. /outer/inner_rdoc.html">inner</a>] , summary
108
113
end
109
114
110
115
def test_generate_dry_run
You can’t perform that action at this time.
0 commit comments