1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/rdoc] Start with open when only one visible class/module

https://github.com/ruby/rdoc/commit/6bb93001db
This commit is contained in:
Nobuyoshi Nakada 2022-03-13 20:38:19 +09:00 committed by git
parent 976431d9ed
commit 0bf194fb33

View file

@ -14,18 +14,20 @@
-%><code><%= index_klass.name %></code><%-
end
end
-%>
<%- traverse = proc do |klasses| -%>
if top = all_classes[nil]
solo = top.one? {|klass| klass.display?}
traverse = proc do |klasses| -%>
<ul class="link-list">
<%- klasses.each do |index_klass| -%>
<%- if children = all_classes[index_klass.full_name] -%>
<li><details><summary><% link.call(index_klass) %></summary>
<%- traverse.call(children) -%>
<%- klasses.each do |index_klass| -%>
<%- if children = all_classes[index_klass.full_name] -%>
<li><details<% if solo; solo = false %> open<% end %>><summary><% link.call(index_klass) %></summary>
<%- traverse.call(children) -%>
</ul></details>
<%- elsif index_klass.display? -%>
<%- elsif index_klass.display? -%>
<li><% link.call(index_klass, true) %>
<%- end -%>
<%- end -%>
<%- end -%>
<%- traverse.call(top) -%>
<%- end -%>
<%- traverse.call(all_classes[nil]) -%>
</div>