Skip to content

Commit 196cb5e

Browse files
authored
Merge pull request #775 from benoittgt/remove-empty-lines
Remove empty lines from html file by using ERB trim_mode flag
2 parents 3c870ce + 9e27299 commit 196cb5e

16 files changed

+131
-134
lines changed

lib/rdoc/generator/template/darkfish/_head.rhtml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515

1616
<link href="<%= asset_rel_prefix %>/css/fonts.css" rel="stylesheet">
1717
<link href="<%= asset_rel_prefix %>/css/rdoc.css" rel="stylesheet">
18-
<% if @options.template_stylesheets.flatten.any? then %>
19-
<% @options.template_stylesheets.flatten.each do |stylesheet| %>
18+
<%- if @options.template_stylesheets.flatten.any? then -%>
19+
<%- @options.template_stylesheets.flatten.each do |stylesheet| -%>
2020
<link href="<%= asset_rel_prefix %>/<%= File.basename stylesheet %>" rel="stylesheet">
21-
<% end %>
22-
<% end %>
23-
21+
<%- end -%>
22+
<%- end -%>

lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<% if !svninfo.empty? then %>
1+
<%- if !svninfo.empty? then %>
22
<div id="file-svninfo-section" class="nav-section">
33
<h3>VCS Info</h3>
44

@@ -16,4 +16,4 @@
1616
</dl>
1717
</div>
1818
</div>
19-
<% end %>
19+
<%- end -%>

lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<h3>Class and Module Index</h3>
33

44
<ul class="link-list">
5-
<% @modsort.each do |index_klass| %>
5+
<%- @modsort.each do |index_klass| -%>
66
<li><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.full_name %></a>
7-
<% end %>
7+
<%- end -%>
88
</ul>
99
</div>
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
<% unless klass.extends.empty? then %>
1+
<%- unless klass.extends.empty? then %>
22
<div id="extends-section" class="nav-section">
33
<h3>Extended With Modules</h3>
44

55
<ul class="link-list">
6-
<% klass.each_extend do |ext| %>
7-
<% unless String === ext.module then %>
6+
<%- klass.each_extend do |ext| -%>
7+
<%- unless String === ext.module then -%>
88
<li><a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a>
9-
<% else %>
9+
<%- else -%>
1010
<li><span class="extend"><%= ext.name %></span>
11-
<% end %>
12-
<% end %>
11+
<%- end -%>
12+
<%- end -%>
1313
</ul>
1414
</div>
15-
<% end %>
15+
<%- end -%>

lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<h3>Defined In</h3>
33

44
<ul>
5-
<% klass.in_files.each do |tl| %>
5+
<%- klass.in_files.each do |tl| -%>
66
<li><%= h tl.relative_name %>
7-
<% end %>
7+
<%- end -%>
88
</ul>
99
</div>
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
<% unless klass.includes.empty? then %>
1+
<%- unless klass.includes.empty? then %>
22
<div id="includes-section" class="nav-section">
33
<h3>Included Modules</h3>
44

55
<ul class="link-list">
6-
<% klass.each_include do |inc| %>
7-
<% unless String === inc.module then %>
6+
<%- klass.each_include do |inc| -%>
7+
<%- unless String === inc.module then -%>
88
<li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a>
9-
<% else %>
9+
<%- else -%>
1010
<li><span class="include"><%= inc.name %></span>
11-
<% end %>
12-
<% end %>
11+
<%- end -%>
12+
<%- end -%>
1313
</ul>
1414
</div>
15-
<% end %>
15+
<%- end -%>

lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
<h3>Documentation</h3>
33

44
<ul>
5-
<% installed.each do |name, href, exists, type, _| %>
6-
<% next if type == :extra %>
5+
<%- installed.each do |name, href, exists, type, _| -%>
6+
<%- next if type == :extra -%>
77
<li class="folder">
8-
<% if exists then %>
8+
<%- if exists then -%>
99
<a href="<%= href %>"><%= h name %></a>
10-
<% else %>
10+
<%- else -%>
1111
<%= h name %>
12-
<% end %>
13-
<% end %>
12+
<%- end -%>
13+
<%- end -%>
1414
</ul>
1515
</div>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<% unless klass.method_list.empty? then %>
1+
<%- unless klass.method_list.empty? then %>
22
<!-- Method Quickref -->
33
<div id="method-list-section" class="nav-section">
44
<h3>Methods</h3>
55

66
<ul class="link-list" role="directory">
7-
<% klass.each_method do |meth| %>
8-
<li <% if meth.calls_super %>class="calls-super" <% end %>><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= h meth.name %></a>
9-
<% end %>
7+
<%- klass.each_method do |meth| -%>
8+
<li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= h meth.name -%></a>
9+
<%- end -%>
1010
</ul>
1111
</div>
12-
<% end %>
12+
<%- end -%>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<% simple_files = @files.select { |f| f.text? } %>
2-
<% unless simple_files.empty? then %>
1+
<%- simple_files = @files.select { |f| f.text? } %>
2+
<%- unless simple_files.empty? then -%>
33
<div id="fileindex-section" class="nav-section">
44
<h3>Pages</h3>
55

66
<ul class="link-list">
7-
<% simple_files.each do |f| %>
7+
<%- simple_files.each do |f| -%>
88
<li><a href="<%= rel_prefix %>/<%= f.path %>"><%= h f.page_name %></a>
9-
<% end %>
9+
<%- end -%>
1010
</ul>
1111
</div>
12-
<% end %>
12+
<%- end -%>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<% if klass.type == 'class' then %>
1+
<%- if klass.type == 'class' then %>
22
<div id="parent-class-section" class="nav-section">
33
<h3>Parent</h3>
44

5-
<% if klass.superclass and not String === klass.superclass then %>
5+
<%- if klass.superclass and not String === klass.superclass then -%>
66
<p class="link"><a href="<%= klass.aref_to klass.superclass.path %>"><%= klass.superclass.full_name %></a>
7-
<% else %>
7+
<%- else -%>
88
<p class="link"><%= klass.superclass %>
9-
<% end %>
9+
<%- end -%>
1010
</div>
11-
<% end %>
11+
<%- end -%>

0 commit comments

Comments
 (0)