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
21 changes: 21 additions & 0 deletions .herb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 0.9.0

linter:
enabled: true

rules:
# RDoc templates are not Rails partials — instance variables are the
# standard way to pass data from the generator to templates.
erb-no-instance-variables-in-partials:
enabled: false

# Template output is generated from trusted RDoc data, not user input.
erb-no-unsafe-script-interpolation:
enabled: false

# Same: attribute values come from trusted RDoc data.
erb-no-output-in-attribute-position:
enabled: false

formatter:
enabled: false
2 changes: 1 addition & 1 deletion lib/rdoc/generator/template/aliki/_head.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<%- elsif @title %>
<meta name="keywords" content="ruby,documentation,<%= h @title %>">
<%- if @options.main_page and
main_page = @files.find { |f| f.full_name == @options.main_page } then %>
main_page = @files.find { |f| f.full_name == @options.main_page } %>
<meta
name="description"
content="<%= h "#{@title}: #{excerpt(main_page.comment)}" %>"
Expand Down
14 changes: 8 additions & 6 deletions lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%- unless klass.extends.empty? then %>
<%- unless klass.extends.empty? %>
<div id="extends-section" class="nav-section">
<details class="nav-section-collapsible" open>
<summary class="nav-section-header">
Expand All @@ -13,11 +13,13 @@

<ul class="nav-list">
<%- klass.extends.each do |ext| %>
<%- unless String === ext.module then %>
<li><a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a></li>
<%- else %>
<li><span class="extend"><%= ext.name %></span></li>
<%- end %>
<li>
<%- unless String === ext.module %>
<a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a>
<%- else %>
<span class="extend"><%= ext.name %></span>
<%- end %>
</li>
<%- end %>
</ul>
</details>
Expand Down
14 changes: 8 additions & 6 deletions lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%- unless klass.includes.empty? then %>
<%- unless klass.includes.empty? %>
<div id="includes-section" class="nav-section">
<details class="nav-section-collapsible" open>
<summary class="nav-section-header">
Expand All @@ -13,11 +13,13 @@

<ul class="nav-list">
<%- klass.includes.each do |inc| %>
<%- unless String === inc.module then %>
<li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a></li>
<%- else %>
<li><span class="include"><%= inc.name %></span></li>
<%- end %>
<li>
<%- unless String === inc.module %>
<a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a>
<%- else %>
<span class="include"><%= inc.name %></span>
<%- end %>
</li>
<%- end %>
</ul>
</details>
Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<%- installed.each do |name, href, exists, type, _| %>
<%- next if type == :extra %>
<li class="folder">
<%- if exists then %>
<%- if exists %>
<a href="<%= href %>"><%= h name %></a>
<%- else %>
<%= h name %>
Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<%- dir = current.full_name[%r{\A[^/]+(?=/)}] || current.page_name %>
<%- end %>

<%- unless simple_files.empty? then %>
<%- unless simple_files.empty? %>
<div id="fileindex-section" class="nav-section">
<details class="nav-section-collapsible" <%= 'open' unless @inside_class_file %>>
<summary class="nav-section-header">
Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%- unless klass.sections.length == 1 then %>
<%- unless klass.sections.length == 1 %>
<div id="sections-section" class="nav-section">
<details class="nav-section-collapsible" open>
<summary class="nav-section-header">
Expand Down
34 changes: 17 additions & 17 deletions lib/rdoc/generator/template/aliki/class.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<% if namespace[:self] %>
<span><%= namespace[:name] %></span>
<% else %>
<a href="<%= namespace[:path] %>"><%= namespace[:name] %></a><span>::</span>
<a href="<%= namespace[:path] %>"><%= namespace[:name] %></a><span class="separator">::</span>
<% end %>
</li>
<% end %>
Expand All @@ -41,31 +41,31 @@
<%- klass.each_section do |section, constants, attributes| %>
<span id="<%= section.legacy_aref %>" class="legacy-anchor"></span>
<section class="documentation-section anchor-link">
<%- if section.title then %>
<%- if section.title %>
<header class="documentation-section-title">
<h2 id="<%= section.aref %>">
<a href="#<%= section.aref %>"><%= section.title %></a>
</h2>
</header>
<%- end %>

<%- if section.comment then %>
<%- if section.comment %>
<div>
<%= section.description %>
</div>
<%- end %>

<%- unless constants.empty? then %>
<%- unless constants.empty? %>
<section class="constants-list">
<header>
<h3 id="<%= section.aref %>-constants"><a href="#<%= section.aref %>-constants">Constants</a></h3>
</header>
<dl>
<%- constants.each do |const| %>
<dt id="<%= const.name %>"><%= const.name %></dt>
<%- if const.comment then %>
<%- if const.comment %>
<dd>
<%- if const.mixin_from then %>
<%- if const.mixin_from %>
<div class="mixin-from">
Included from <a href="<%= klass.aref_to(const.mixin_from.path) %>"><%= const.mixin_from.full_name %></a>
</div>
Expand All @@ -80,7 +80,7 @@
</section>
<%- end %>

<%- unless attributes.empty? then %>
<%- unless attributes.empty? %>
<section class="attribute-method-details method-section">
<header>
<h3 id="<%= section.aref %>-attributes"><a href="#<%= section.aref %>-attributes">Attributes</a></h3>
Expand All @@ -96,12 +96,12 @@
</div>

<div class="method-description">
<%- if attrib.mixin_from then %>
<%- if attrib.mixin_from %>
<div class="mixin-from">
<%= attrib.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(attrib.mixin_from.path) %>"><%= attrib.mixin_from.full_name %></a>
</div>
<%- end %>
<%- if attrib.comment then %>
<%- if attrib.comment %>
<%= attrib.description.strip %>
<%- else %>
<p class="missing-docs">(Not documented)</p>
Expand All @@ -124,7 +124,7 @@
<%- methods.each do |method| %>
<div id="<%= method.aref %>" class="method-detail anchor-link <%= method.is_alias_for ? "method-alias" : '' %>">
<div class="method-header">
<%- if (call_seq = method.call_seq) then %>
<%- if (call_seq = method.call_seq) %>
<%- call_seq.strip.split("\n").each_with_index do |call_seq, i| %>
<div class="method-heading">
<a href="#<%= method.aref %>" title="Link to this method">
Expand All @@ -136,7 +136,7 @@
</a>
</div>
<%- end %>
<%- elsif method.has_call_seq? then %>
<%- elsif method.has_call_seq? %>
<div class="method-heading">
<a href="#<%= method.aref %>" title="Link to this method">
<span class="method-name"><%= h method.name %></span>
Expand All @@ -163,19 +163,19 @@
</div>
<%- end %>

<%- unless method.skip_description? then %>
<%- unless method.skip_description? %>
<div class="method-description">
<%- if method.mixin_from then %>
<%- if method.mixin_from %>
<div class="mixin-from">
<%= method.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(method.mixin_from.path) %>"><%= method.mixin_from.full_name %></a>
</div>
<%- end %>
<%- if method.comment then %>
<%- if method.comment %>
<%= method.description.strip %>
<%- else %>
<p class="missing-docs">(Not documented)</p>
<%- end %>
<%- if method.calls_super then %>
<%- if method.calls_super %>
<div class="method-calls-super">
Calls superclass method
<%=
Expand All @@ -187,7 +187,7 @@
</div>
<%- end %>

<%- unless method.aliases.empty? then %>
<%- unless method.aliases.empty? %>
<div class="aliases">
Also aliased as: <%= method.aliases.map do |aka|
if aka.parent then # HACK lib/rexml/encodings
Expand All @@ -199,7 +199,7 @@
</div>
<%- end %>

<%- if method.is_alias_for then %>
<%- if method.is_alias_for %>
<div class="aliases">
Alias for: <a href="<%= klass.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/generator/template/aliki/servlet_root.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

<%- gems = installed.select { |_, _, _, type,| type == :gem } %>
<%- missing = gems.reject { |_, _, exists,| exists } %>
<%- unless missing.empty? then %>
<%- unless missing.empty? %>
<h2>Missing Gem Documentation</h2>

<p>You are missing documentation for some of your installed gems.
Expand Down
14 changes: 8 additions & 6 deletions lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<%- unless klass.extends.empty? then %>
<%- unless klass.extends.empty? %>
<div id="extends-section" class="nav-section">
<h3>Extended With Modules</h3>

<ul class="link-list">
<%- klass.extends.each do |ext| %>
<%- unless String === ext.module then %>
<li><a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a></li>
<%- else %>
<li><span class="extend"><%= ext.name %></span></li>
<%- end %>
<li>
<%- unless String === ext.module %>
<a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a>
<%- else %>
<span class="extend"><%= ext.name %></span>
<%- end %>
</li>
<%- end %>
</ul>
</div>
Expand Down
14 changes: 8 additions & 6 deletions lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<%- unless klass.includes.empty? then %>
<%- unless klass.includes.empty? %>
<div id="includes-section" class="nav-section">
<h3>Included Modules</h3>

<ul class="link-list">
<%- klass.includes.each do |inc| %>
<%- unless String === inc.module then %>
<li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a></li>
<%- else %>
<li><span class="include"><%= inc.name %></span></li>
<%- end %>
<li>
<%- unless String === inc.module %>
<a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a>
<%- else %>
<span class="include"><%= inc.name %></span>
<%- end %>
</li>
<%- end %>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<%- installed.each do |name, href, exists, type, _| %>
<%- next if type == :extra %>
<li class="folder">
<%- if exists then %>
<%- if exists %>
<a href="<%= href %>"><%= h name %></a>
<%- else %>
<%= h name %>
Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<%- if defined?(current) %>
<%- dir = current.full_name[%r{\A[^/]+(?=/)}] || current.page_name %>
<%- end %>
<%- unless simple_files.empty? then %>
<%- unless simple_files.empty? %>
<div id="fileindex-section" class="nav-section">
<h3>Pages</h3>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%- unless klass.sections.length == 1 then %>
<%- unless klass.sections.length == 1 %>
<div id="sections-section" class="nav-section">
<h3>Sections</h3>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<%- comment = if current.respond_to? :comment_location then
<%- comment = if current.respond_to? :comment_location
current.comment_location
else
current.comment
end
table = current.parse(comment).table_of_contents.dup

if table.length > 1 then %>
if table.length > 1 %>
<div class="nav-section">
<h3>Table of Contents</h3>

Expand All @@ -17,18 +17,18 @@
<%- level = table.first&.level %>
<%- while table.first && table.first.level >= level %>
<%- heading = table.shift %>
<li>
<%- if table.first.nil? || table.first.level <= heading.level %>
<li><% display_link.call heading %></li>
<% display_link.call heading %>
<%- else %>
<li>
<details open>
<summary><%- display_link.call heading %></summary>
<ul class="link-list" role="directory">
<% list_siblings.call %>
</ul>
</details>
</li>
<%- end %>
</li>
<%- end %>
<%- end %>

Expand Down
Loading
Loading