File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
lib/rdoc/generator/template/darkfish Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
<%- simple_files = @files.select { |f| f.text? } %>
2
+ <%- if defined?(current) -%>
3
+ <%- dir = current.full_name[%r{\A[^/]+(?=/)}] || current.page_name -%>
4
+ <%- end -%>
2
5
<%- unless simple_files.empty? then -%>
3
6
<div id ="fileindex-section " class ="nav-section ">
4
7
< h3 > Pages</ h3 >
12
15
< li > < a href ="<%= rel_prefix %> / <%= f . path %> "> <%= h f . page_name %> </ a >
13
16
<%- next -%>
14
17
<%- end -%>
15
- < li > < details > < summary > <%
18
+ < li > < details <% if dir == n %> open <% end %> > < summary > <%
16
19
if n == f . page_name
17
20
%> < a href ="<%= rel_prefix %> / <%= f . path %> "> <%= h n %> </ a > <%
18
21
else
Original file line number Diff line number Diff line change @@ -110,6 +110,10 @@ def test_generate_page
110
110
assert_match ( re , index )
111
111
summary = index [ re ]
112
112
assert_match %r[<a href="\. /outer/inner_rdoc.html">inner</a>] , summary
113
+ re = %r[<details open><summary><a href="\. /outer_rdoc\. html">outer</a></summary>.*?</details>]m
114
+ assert_match ( re , File . read ( 'outer_rdoc.html' ) )
115
+ re = %r[<details open><summary><a href="\. \. /outer_rdoc\. html">outer</a></summary>.*?</details>]m
116
+ assert_match ( re , File . read ( 'outer/inner_rdoc.html' ) )
113
117
end
114
118
115
119
def test_generate_dry_run
You can’t perform that action at this time.
0 commit comments