Skip to content

Commit

Permalink
Merge pull request #336 from jonathanhefner/hotwire-fonts
Browse files Browse the repository at this point in the history
Use fonts from Hotwire documentation
  • Loading branch information
jonathanhefner authored Oct 18, 2023
2 parents 127b40e + 23dbe52 commit a4710d4
Show file tree
Hide file tree
Showing 18 changed files with 237 additions and 128 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Main (3.0.0.alpha)
* [#268](https://github.com/rails/sdoc/pull/268) Add initial dark mode support [@p8](https://github.com/p8)
* [#279](https://github.com/rails/sdoc/pull/279) Redesign "Appears in" file list [@jonathanhefner](https://github.com/jonathanhefner)
* [#280](https://github.com/rails/sdoc/pull/280) Redesign banner and mobile menu bar [@jonathanhefner](https://github.com/jonathanhefner)
* [#283](https://github.com/rails/sdoc/pull/283) Rework typography [@jonathanhefner](https://github.com/jonathanhefner)
* [#283](https://github.com/rails/sdoc/pull/283), [#336](https://github.com/rails/sdoc/pull/336) Rework typography [@jonathanhefner](https://github.com/jonathanhefner)
* [#286](https://github.com/rails/sdoc/pull/286) Render breadcrumb links for module's parents [@jonathanhefner](https://github.com/jonathanhefner)
* [#287](https://github.com/rails/sdoc/pull/287) Generate uniform `<h1>` headings for all modules [@jonathanhefner](https://github.com/jonathanhefner)
* [#291](https://github.com/rails/sdoc/pull/291) Remove keyboard shortcuts that use meta keys [@jonathanhefner](https://github.com/jonathanhefner)
Expand Down
2 changes: 1 addition & 1 deletion config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ unless Dir.exist?(root)
end

use Rack::Static,
:urls => ["/files", "/images", "/js", "/css", "/panel", "/i", "/classes", "/ruby", "/rails"],
:urls => ["/files", "/images", "/js", "/css", "/panel", "/i", "/fonts", "/classes", "/ruby", "/rails"],
:root => root
run lambda { |env|
[
Expand Down
8 changes: 4 additions & 4 deletions lib/rdoc/generator/template/rails/_context.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<%# File only: requires %>
<% unless @context.requires.empty? %>
<div class="content__divider">Required Files</div>
<h2 class="content__divider">Required Files</h2>
<ul>
<% @context.requires.each do |req| %>
<li><%= full_name req.name %></li>
Expand All @@ -19,7 +19,7 @@

<%# Module only: ancestors %>
<% unless @context.is_a?(RDoc::TopLevel) || (ancestors = module_ancestors(@context)).empty? %>
<div class="content__divider">Inherits From</div>
<h2 class="content__divider">Inherits From</h2>
<ul>
<% ancestors.each do |kind, ancestor| %>
<li>
Expand All @@ -34,7 +34,7 @@
<% sections = @context.sections.select { |s| s.title }.sort_by{ |s| s.title.to_s } %>
<% unless sections.empty? then %>
<!-- Sections -->
<div class="content__divider">Sections</div>
<h2 class="content__divider">Sections</h2>
<ul>
<% sections.each do |section| %>
<li><%= link_to h(section.title), "##{section.aref}" %></li>
Expand Down Expand Up @@ -156,7 +156,7 @@

<% unless @context.classes_and_modules.empty? %>
<!-- Namespace -->
<div id="namespace" class="content__divider">Namespace</div>
<h2 id="namespace" class="content__divider">Namespace</h2>
<ul>
<% @context.classes_and_modules.sort.each do |mod| %>
<li><%= link_to mod %></li>
Expand Down
8 changes: 3 additions & 5 deletions lib/rdoc/generator/template/rails/_file_nav.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
<%= outline(@context) %>
</div>
<% else %>
<ul class="nav__list">
<% @context.each_classmodule do |rdoc_module| %>
<li><%= button_to_search rdoc_module %></li>
<% end %>
</ul>
<% @context.each_classmodule do |rdoc_module| %>
<%= button_to_search rdoc_module %>
<% end %>
<% end %>
6 changes: 6 additions & 0 deletions lib/rdoc/generator/template/rails/_head.rhtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<%= base_tag_for_context(@context) %>

<link rel="preload" href="/fonts/Bitter-Roman.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/fonts/Bitter-Italic.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/fonts/Jost-Roman.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/fonts/Jost-Italic.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/fonts/RobotoMono-Roman.woff2" as="font" type="font/woff2" crossorigin>

<link rel="stylesheet" href="/css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="/css/highlight.css" type="text/css" media="screen" />

Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/generator/template/rails/_module_nav.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<ul class="nav__list">
<% methods.each do |rdoc_method| %>
<li><%= link_to short_name(rdoc_method), rdoc_method,
class: "nav__method-link#{"--singleton" if rdoc_method.singleton}" %></li>
class: "ref-link nav__method-link#{"--singleton" if rdoc_method.singleton}" %></li>
<% end %>
</ul>
<% end %>
2 changes: 1 addition & 1 deletion lib/rdoc/generator/template/rails/class.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<% inline "_context.rhtml" %>

<div class="content__divider">Definition files</div>
<h2 class="content__divider">Definition files</h2>
<%= more_less_ul @context.in_files.map { |file| link_to file }, 5..9 %>
</main>
</body>
Expand Down
Loading

0 comments on commit a4710d4

Please sign in to comment.