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 44 < h3 > Pages</ h3 >
55
66 < 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? -%>
812 < 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 >
926 <%- end -%>
1027 </ ul >
1128</ div >
Original file line number Diff line number Diff line change @@ -105,6 +105,11 @@ def test_generate_page
105105 @g . generate
106106 assert_file 'outer_rdoc.html'
107107 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
108113 end
109114
110115 def test_generate_dry_run
You can’t perform that action at this time.
0 commit comments