зеркало из https://github.com/github/ruby.git
[ruby/rdoc] Expand the enclosing tree of the current file
https://github.com/ruby/rdoc/commit/f9f90ef2ff
This commit is contained in:
Родитель
dafe5c1323
Коммит
92ef73a918
|
@ -1,4 +1,7 @@
|
||||||
<%- simple_files = @files.select { |f| f.text? } %>
|
<%- simple_files = @files.select { |f| f.text? } %>
|
||||||
|
<%- if defined?(current) -%>
|
||||||
|
<%- dir = current.full_name[%r{\A[^/]+(?=/)}] || current.page_name -%>
|
||||||
|
<%- end -%>
|
||||||
<%- unless simple_files.empty? then -%>
|
<%- unless simple_files.empty? then -%>
|
||||||
<div id="fileindex-section" class="nav-section">
|
<div id="fileindex-section" class="nav-section">
|
||||||
<h3>Pages</h3>
|
<h3>Pages</h3>
|
||||||
|
@ -12,7 +15,7 @@
|
||||||
<li><a href="<%= rel_prefix %>/<%= f.path %>"><%= h f.page_name %></a>
|
<li><a href="<%= rel_prefix %>/<%= f.path %>"><%= h f.page_name %></a>
|
||||||
<%- next -%>
|
<%- next -%>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
<li><details><summary><%
|
<li><details<% if dir == n %> open<% end %>><summary><%
|
||||||
if n == f.page_name
|
if n == f.page_name
|
||||||
%><a href="<%= rel_prefix %>/<%= f.path %>"><%= h n %></a><%
|
%><a href="<%= rel_prefix %>/<%= f.path %>"><%= h n %></a><%
|
||||||
else
|
else
|
||||||
|
|
|
@ -110,6 +110,10 @@ class TestRDocGeneratorDarkfish < RDoc::TestCase
|
||||||
assert_match(re, index)
|
assert_match(re, index)
|
||||||
summary = index[re]
|
summary = index[re]
|
||||||
assert_match %r[<a href="\./outer/inner_rdoc.html">inner</a>], summary
|
assert_match %r[<a href="\./outer/inner_rdoc.html">inner</a>], summary
|
||||||
|
re = %r[<details open><summary><a href="\./outer_rdoc\.html">outer</a></summary>.*?</details>]m
|
||||||
|
assert_match(re, File.read('outer_rdoc.html'))
|
||||||
|
re = %r[<details open><summary><a href="\.\./outer_rdoc\.html">outer</a></summary>.*?</details>]m
|
||||||
|
assert_match(re, File.read('outer/inner_rdoc.html'))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_generate_dry_run
|
def test_generate_dry_run
|
||||||
|
|
Загрузка…
Ссылка в новой задаче