ruby-changes:62347
From: Benoit <ko1@a...>
Date: Wed, 22 Jul 2020 02:42:22 +0900 (JST)
Subject: [ruby-changes:62347] 7693aa7056 (master): [ruby/rdoc] Remove empty lines from html file by using ERB trim_mode flag
https://git.ruby-lang.org/ruby.git/commit/?id=7693aa7056 From 7693aa705619752b57de192951cc688338653715 Mon Sep 17 00:00:00 2001 From: Benoit Tigeot <benoit@h...> Date: Thu, 2 Jul 2020 22:33:09 +0200 Subject: [ruby/rdoc] Remove empty lines from html file by using ERB trim_mode flag https://github.com/ruby/rdoc/commit/9e27299a46 diff --git a/lib/rdoc/generator/template/darkfish/_head.rhtml b/lib/rdoc/generator/template/darkfish/_head.rhtml index 8304310..e61fce1 100644 --- a/lib/rdoc/generator/template/darkfish/_head.rhtml +++ b/lib/rdoc/generator/template/darkfish/_head.rhtml @@ -15,9 +15,8 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/_head.rhtml#L15 <link href="<%= asset_rel_prefix %>/css/fonts.css" rel="stylesheet"> <link href="<%= asset_rel_prefix %>/css/rdoc.css" rel="stylesheet"> -<% if @options.template_stylesheets.flatten.any? then %> -<% @options.template_stylesheets.flatten.each do |stylesheet| %> +<%- if @options.template_stylesheets.flatten.any? then -%> +<%- @options.template_stylesheets.flatten.each do |stylesheet| -%> <link href="<%= asset_rel_prefix %>/<%= File.basename stylesheet %>" rel="stylesheet"> -<% end %> -<% end %> - +<%- end -%> +<%- end -%> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml index e889f80..22a12d9 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml#L1 -<% if !svninfo.empty? then %> +<%- if !svninfo.empty? then %> <div id="file-svninfo-section" class="nav-section"> <h3>VCS Info</h3> @@ -16,4 +16,4 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml#L16 </dl> </div> </div> -<% end %> +<%- end -%> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml index fe54d83..530f25c 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml @@ -2,8 +2,8 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml#L2 <h3>Class and Module Index</h3> <ul class="link-list"> - <% @modsort.each do |index_klass| %> + <%- @modsort.each do |index_klass| -%> <li><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.full_name %></a> - <% end %> + <%- end -%> </ul> </div> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml index 2bd8efe..7602076 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml @@ -1,15 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml#L1 -<% unless klass.extends.empty? then %> +<%- unless klass.extends.empty? then %> <div id="extends-section" class="nav-section"> <h3>Extended With Modules</h3> <ul class="link-list"> - <% klass.each_extend do |ext| %> - <% unless String === ext.module then %> + <%- klass.each_extend do |ext| -%> + <%- unless String === ext.module then -%> <li><a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a> - <% else %> + <%- else -%> <li><span class="extend"><%= ext.name %></span> - <% end %> - <% end %> + <%- end -%> + <%- end -%> </ul> </div> -<% end %> +<%- end -%> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml index 0ba1d2b..74869a4 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml @@ -2,8 +2,8 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml#L2 <h3>Defined In</h3> <ul> -<% klass.in_files.each do |tl| %> +<%- klass.in_files.each do |tl| -%> <li><%= h tl.relative_name %> -<% end %> +<%- end -%> </ul> </div> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml index d141098..5b600e5 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml @@ -1,15 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml#L1 -<% unless klass.includes.empty? then %> +<%- unless klass.includes.empty? then %> <div id="includes-section" class="nav-section"> <h3>Included Modules</h3> <ul class="link-list"> - <% klass.each_include do |inc| %> - <% unless String === inc.module then %> + <%- klass.each_include do |inc| -%> + <%- unless String === inc.module then -%> <li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a> - <% else %> + <%- else -%> <li><span class="include"><%= inc.name %></span> - <% end %> - <% end %> + <%- end -%> + <%- end -%> </ul> </div> -<% end %> +<%- end -%> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml index 1285bfd..faed7e0 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml @@ -2,14 +2,14 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml#L2 <h3>Documentation</h3> <ul> - <% installed.each do |name, href, exists, type, _| %> - <% next if type == :extra %> + <%- installed.each do |name, href, exists, type, _| -%> + <%- next if type == :extra -%> <li class="folder"> - <% if exists then %> + <%- if exists then -%> <a href="<%= href %>"><%= h name %></a> - <% else %> + <%- else -%> <%= h name %> - <% end %> - <% end %> + <%- end -%> + <%- end -%> </ul> </div> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml index 45df08d..5b4c295 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml @@ -1,12 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml#L1 -<% unless klass.method_list.empty? then %> +<%- unless klass.method_list.empty? then %> <!-- Method Quickref --> <div id="method-list-section" class="nav-section"> <h3>Methods</h3> <ul class="link-list" role="directory"> - <% klass.each_method do |meth| %> - <li <% if meth.calls_super %>class="calls-super" <% end %>><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= h meth.name %></a> - <% end %> + <%- klass.each_method do |meth| -%> + <li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= h meth.name -%></a> + <%- end -%> </ul> </div> -<% end %> +<%- end -%> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml index 5f39825..8ec83ab 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml @@ -1,12 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml#L1 -<% simple_files = @files.select { |f| f.text? } %> -<% unless simple_files.empty? then %> +<%- simple_files = @files.select { |f| f.text? } %> +<%- unless simple_files.empty? then -%> <div id="fileindex-section" class="nav-section"> <h3>Pages</h3> <ul class="link-list"> - <% simple_files.each do |f| %> + <%- simple_files.each do |f| -%> <li><a href="<%= rel_prefix %>/<%= f.path %>"><%= h f.page_name %></a> - <% end %> + <%- end -%> </ul> </div> -<% end %> +<%- end -%> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml index cc04852..1420da3 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml @@ -1,11 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml#L1 -<% if klass.type == 'class' then %> +<%- if klass.type == 'class' then %> <div id="parent-class-section" class="nav-section"> <h3>Parent</h3> - <% if klass.superclass and not String === klass.superclass then %> + <%- if klass.superclass and not String === klass.superclass then -%> <p class="link"><a href="<%= klass.aref_to klass.superclass.path %>"><%= klass.superclass.full_name %></a> - <% else %> + <%- else -%> <p class="link"><%= klass.superclass %> - <% end %> + <%- end -%> </div> -<% end %> +<%- end -%> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml index 15ff78b..6dcd2ae 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml @@ -1,11 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml#L1 -<% unless klass.sections.length == 1 then %> +<%- unless klass.sections.length == 1 then %> <div id="sections-section" class="nav-section"> <h3>Sections</h3> <ul class="link-list" role="directory"> - <% klass.sort_sections.each do |section| %> + <%- klass.sort_sections.each do |section| -%> <li><a href="#<%= section.aref %>"><%= h section.titl (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/