Skip to content
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
7 changes: 7 additions & 0 deletions .rdoc_options
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ exclude:
- AGENTS.md
- CLAUDE.md
- lib/rdoc/markdown.kpeg

footer_content:
DOCUMENTATION:
Home: index.html
RESOURCES:
GitHub Repository: https://github.com/ruby/rdoc
Issue Tracker: https://github.com/ruby/rdoc/issues
18 changes: 8 additions & 10 deletions lib/rdoc/generator/template/aliki/_footer.rhtml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<footer class="site-footer">
<% if @options.footer_content && !@options.footer_content.empty? %>
<div class="footer-content">
<% @options.footer_content.each do |column_title, links| %>
<div>
<h3>Documentation</h3>
<h3><%= h column_title %></h3>
<ul>
<li><a href="<%= h asset_rel_path %>/index.html">Home</a></li>
</ul>
</div>

<div>
<h3>Resources</h3>
<ul>
<li><a href="https://ruby.github.io/rdoc/">RDoc Documentation</a></li>
<li><a href="https://github.com/ruby/rdoc">RDoc GitHub</a></li>
<% links.each do |text, url| %>
<li><a href="<%= h url %>"><%= h text %></a></li>
<% end %>
</ul>
</div>
<% end %>
</div>
<% end %>

<div class="footer-bottom">
<p>
Expand Down
7 changes: 6 additions & 1 deletion lib/rdoc/generator/template/aliki/css/rdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,6 @@ footer.site-footer h3 {
font-weight: var(--font-weight-semibold);
color: var(--color-text-primary);
margin: 0 0 var(--space-4) 0;
text-transform: uppercase;
letter-spacing: 0.05em;
}

Expand Down Expand Up @@ -1463,6 +1462,12 @@ footer.site-footer .footer-bottom {
color: var(--color-text-tertiary);
}

footer.site-footer .footer-bottom:first-child {
margin-top: 0;
padding-top: 0;
border-top: none;
}

/* Search */
#search-section {
padding: var(--space-6);
Expand Down
18 changes: 18 additions & 0 deletions lib/rdoc/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,21 @@ class RDoc::Options

attr_accessor :canonical_root

##
# Custom footer content configuration for themes that support it.
# Currently only supported by the Aliki theme.
#
# A hash where keys are column titles and values are hashes of link text => URL pairs.
# Each column will be displayed in the upper footer section.
#
# Example:
# {
# "DOCUMENTATION" => {"Home" => "/index.html", "Guide" => "/guide.html"},
# "RESOURCES" => {"RDoc" => "https://ruby.github.io/rdoc/", "GitHub" => "https://github.com/ruby/rdoc"}
# }

attr_accessor :footer_content

def initialize(loaded_options = nil) # :nodoc:
init_ivars
override loaded_options if loaded_options
Expand Down Expand Up @@ -434,6 +449,7 @@ def init_ivars # :nodoc:
@class_module_path_prefix = nil
@file_path_prefix = nil
@canonical_root = nil
@footer_content = nil
end

def init_with(map) # :nodoc:
Expand Down Expand Up @@ -462,6 +478,7 @@ def init_with(map) # :nodoc:

@apply_default_exclude = map['apply_default_exclude']
@autolink_excluded_words = map['autolink_excluded_words']
@footer_content = map['footer_content']

@rdoc_include = sanitize_path map['rdoc_include']
@static_path = sanitize_path map['static_path']
Expand Down Expand Up @@ -498,6 +515,7 @@ def override(map) # :nodoc:
@autolink_excluded_words = map['autolink_excluded_words'] if map.has_key?('autolink_excluded_words')
@apply_default_exclude = map['apply_default_exclude'] if map.has_key?('apply_default_exclude')
@canonical_root = map['canonical_root'] if map.has_key?('canonical_root')
@footer_content = map['footer_content'] if map.has_key?('footer_content')

@warn_missing_rdoc_ref = map['warn_missing_rdoc_ref'] if map.has_key?('warn_missing_rdoc_ref')

Expand Down
1 change: 1 addition & 0 deletions test/rdoc/rdoc_options_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def test_to_yaml
'class_module_path_prefix' => nil,
'file_path_prefix' => nil,
'canonical_root' => nil,
'footer_content' => nil,
}

assert_equal expected, coder
Expand Down