Skip to content

Commit

Permalink
Add Namespace link in panel
Browse files Browse the repository at this point in the history
The `list.svg` file is from [Feather icons][feather] v4.29.0, and is
[licensed under the MIT license][license].

[feather]: https://feathericons.com/
[license]: https://github.com/feathericons/feather/blob/v4.29.0/LICENSE
  • Loading branch information
jonathanhefner committed Oct 10, 2023
1 parent 826930e commit a0d20c9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/rdoc/generator/template/rails/_context.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@

<% unless @context.classes_and_modules.empty? %>
<!-- Namespace -->
<div class="content__divider">Namespace</div>
<div id="namespace" class="content__divider">Namespace</div>
<ul>
<% (@context.modules.sort + @context.classes.sort).each do |mod| %>
<li>
Expand Down
3 changes: 3 additions & 0 deletions lib/rdoc/generator/template/rails/_module_nav.rhtml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<% unless @context.classes_and_modules.empty? %>
<a href="#namespace" class="namespace-link"><%= short_name(@context) %> namespace</a>
<% end %>
<%= button_to_search @context, display_name: short_name(@context) %>

<% if outline = outline(@context) %>
Expand Down
29 changes: 22 additions & 7 deletions lib/rdoc/generator/template/rails/resources/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,7 @@ a:has(> code):not(:has(> :not(code))) {
text-align: left;
font-family: inherit;
font-size: 1em;

background: url('../i/filter.svg') no-repeat;
background-position-y: 1px;
background-size: 1.1em;
padding: 0 0 0 1.3em;
color: var(--link-color);

word-break: break-word;
}

@media (hover: hover) {
Expand Down Expand Up @@ -461,6 +454,28 @@ html {
}


.panel__nav :is(.namespace-link, .query-button) {
display: block;
word-break: break-word;
}

.panel__nav .namespace-link {
background: url('../i/list.svg') no-repeat;
background-position-y: 1px;
background-size: 1.1em;
padding: 0 0 0 1.3em;

text-decoration: none;
}

.panel__nav .query-button {
background: url('../i/filter.svg') no-repeat;
background-position-y: 1px;
background-size: 1.1em;
padding: 0 0 0 1.3em;
}


/*
* Navigation panel on desktop
*/
Expand Down
1 change: 1 addition & 0 deletions lib/rdoc/generator/template/rails/resources/i/list.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a0d20c9

Please sign in to comment.