Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sidebar scroll and footer display #1152

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions lib/rdoc/generator/darkfish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,6 @@ def assemble_template body_file
return body if body =~ /<html/

head_file = @template_dir + '_head.rhtml'
footer_file = @template_dir + '_footer.rhtml'

<<-TEMPLATE
<!DOCTYPE html>
Expand All @@ -687,8 +686,6 @@ def assemble_template body_file
#{head_file.read}

#{body}

#{footer_file.read}
TEMPLATE
end

Expand Down
29 changes: 23 additions & 6 deletions lib/rdoc/generator/template/darkfish/css/rdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ body {

/* Layout */
display: flex;
flex-wrap: wrap;
flex-direction: column;
min-height: 100vh;
margin: 0;
}

body > :last-child {
Expand Down Expand Up @@ -209,16 +211,35 @@ nav {
border-right: 1px solid #ccc;
position: fixed;
top: 0;
overflow: auto;
bottom: 0;
overflow: hidden;
z-index: 10;

/* Layout */
width: var(--sidebar-width);
min-height: 100vh;
background: white;

display: flex;
flex-direction: column;
}

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;
}

main {
flex: 1;
display: block;
margin: 3em auto 1em;
padding: 0 1em; /* Add padding to keep space between main content and sidebar/right side of the screen */
Expand Down Expand Up @@ -728,8 +749,4 @@ pre {
font-family: "Source Code Pro", Monaco, monospace;
}

footer {
z-index: 20;
}

/* @end */
2 changes: 2 additions & 0 deletions lib/rdoc/generator/template/darkfish/index.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<%= render '_sidebar_pages.rhtml' %>
<%= render '_sidebar_classes.rhtml' %>
</div>

<%= render '_footer.rhtml' %>
</nav>

<main role="main">
Expand Down