зеркало из https://github.com/github/ruby.git
[ruby/rdoc] Fix sidebar scroll again and add missing footer back
(https://github.com/ruby/rdoc/pull/1154) * Add missing footers In #1152 the footer partial was only added to the index.rhtml file. This commit adds the footer partial to the other template files. * Remove unnecessary middle divs in nav * Simplify sidebar's overflow settings Because sidebar needs to be scrollable, its overflow should default to auto. Currently it's set to hidden and force individual elements to set overflow auto, which overcomplicates things. https://github.com/ruby/rdoc/commit/b8c2bcd8db
This commit is contained in:
Родитель
2a933609e7
Коммит
923e36ab21
|
@ -8,14 +8,13 @@
|
|||
</div>
|
||||
|
||||
<%= render '_sidebar_table_of_contents.rhtml' %>
|
||||
<%= render '_sidebar_sections.rhtml' %>
|
||||
<%= render '_sidebar_parent.rhtml' %>
|
||||
<%= render '_sidebar_includes.rhtml' %>
|
||||
<%= render '_sidebar_extends.rhtml' %>
|
||||
<%= render '_sidebar_methods.rhtml' %>
|
||||
|
||||
<div id="class-metadata">
|
||||
<%= render '_sidebar_sections.rhtml' %>
|
||||
<%= render '_sidebar_parent.rhtml' %>
|
||||
<%= render '_sidebar_includes.rhtml' %>
|
||||
<%= render '_sidebar_extends.rhtml' %>
|
||||
<%= render '_sidebar_methods.rhtml' %>
|
||||
</div>
|
||||
<%= render '_footer.rhtml' %>
|
||||
</nav>
|
||||
|
||||
<main role="main" aria-labelledby="<%=h klass.aref %>">
|
||||
|
|
|
@ -212,7 +212,7 @@ nav {
|
|||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
overflow: hidden;
|
||||
overflow: auto;
|
||||
z-index: 10;
|
||||
|
||||
/* Layout */
|
||||
|
@ -228,11 +228,6 @@ nav[hidden] {
|
|||
display: none;
|
||||
}
|
||||
|
||||
nav #project-metadata {
|
||||
overflow: auto; /* Make the content scrollable */
|
||||
flex: 1; /* Take up remaining space */
|
||||
}
|
||||
|
||||
nav footer {
|
||||
padding: 1em;
|
||||
border-top: 1px solid #ccc;
|
||||
|
@ -286,7 +281,7 @@ nav .nav-section {
|
|||
margin-top: 2em;
|
||||
border-top: 2px solid #aaa;
|
||||
font-size: 90%;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
nav h2 {
|
||||
|
|
|
@ -4,14 +4,11 @@
|
|||
<nav id="navigation" role="navigation">
|
||||
<div id="project-navigation">
|
||||
<%= render '_sidebar_navigation.rhtml' %>
|
||||
|
||||
<%= render '_sidebar_search.rhtml' %>
|
||||
</div>
|
||||
|
||||
<div id="project-metadata">
|
||||
<%= render '_sidebar_pages.rhtml' %>
|
||||
<%= render '_sidebar_classes.rhtml' %>
|
||||
</div>
|
||||
<%= render '_sidebar_pages.rhtml' %>
|
||||
<%= render '_sidebar_classes.rhtml' %>
|
||||
|
||||
<%= render '_footer.rhtml' %>
|
||||
</nav>
|
||||
|
|
|
@ -8,10 +8,9 @@
|
|||
</div>
|
||||
|
||||
<%= render '_sidebar_table_of_contents.rhtml' %>
|
||||
<%= render '_sidebar_pages.rhtml' %>
|
||||
|
||||
<div id="project-metadata">
|
||||
<%= render '_sidebar_pages.rhtml' %>
|
||||
</div>
|
||||
<%= render '_footer.rhtml' %>
|
||||
</nav>
|
||||
|
||||
<main role="main" aria-label="Page <%=h file.full_name%>">
|
||||
|
|
|
@ -2,14 +2,15 @@
|
|||
<%= render '_sidebar_toggle.rhtml' %>
|
||||
|
||||
<nav id="navigation" role="navigation">
|
||||
<%= render '_sidebar_navigation.rhtml' %>
|
||||
|
||||
<%= render '_sidebar_search.rhtml' %>
|
||||
|
||||
<div id="project-metadata">
|
||||
<%= render '_sidebar_pages.rhtml' %>
|
||||
<%= render '_sidebar_classes.rhtml' %>
|
||||
<div id="project-navigation">
|
||||
<%= render '_sidebar_navigation.rhtml' %>
|
||||
<%= render '_sidebar_search.rhtml' %>
|
||||
</div>
|
||||
|
||||
<%= render '_sidebar_pages.rhtml' %>
|
||||
<%= render '_sidebar_classes.rhtml' %>
|
||||
|
||||
<%= render '_footer.rhtml' %>
|
||||
</nav>
|
||||
|
||||
<main role="main">
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
<%= render '_sidebar_search.rhtml' %>
|
||||
</div>
|
||||
|
||||
<%= render '_sidebar_installed.rhtml' %>
|
||||
<%= render '_sidebar_installed.rhtml' %>
|
||||
<%= render '_footer.rhtml' %>
|
||||
</nav>
|
||||
|
||||
<main role="main">
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
<%= render '_sidebar_search.rhtml' %>
|
||||
</div>
|
||||
|
||||
<%= render '_footer.rhtml' %>
|
||||
</nav>
|
||||
<main role="main">
|
||||
<h1 class="class"><%= h @title %></h1>
|
||||
|
|
|
@ -115,7 +115,7 @@ class TestRDocGeneratorDarkfish < RDoc::TestCase
|
|||
assert_match(%r[Klass/Inner\.html".*>Inner<], summary)
|
||||
|
||||
klass = File.binread('Klass.html')
|
||||
klassnav = klass[%r[<div class="nav-section">.*<div id="class-metadata">]m]
|
||||
klassnav = klass[%r[<div class="nav-section">.*]m]
|
||||
assert_match(
|
||||
%r[<li>\s*<details open>\s*<summary>\s*<a href=\S+>Heading 1</a>\s*</summary>\s*<ul]m,
|
||||
klassnav
|
||||
|
|
Загрузка…
Ссылка в новой задаче