From d7b6717d2af93ea398bea9c897589e49f6b1c851 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Thu, 16 Oct 2025 14:07:29 +0100 Subject: [PATCH 1/4] Add missing HTML tags --- lib/rdoc/generator/template/darkfish/_footer.rhtml | 6 +++--- .../generator/template/darkfish/_sidebar_extends.rhtml | 6 +++--- .../template/darkfish/_sidebar_includes.rhtml | 4 ++-- .../template/darkfish/_sidebar_installed.rhtml | 1 + .../generator/template/darkfish/_sidebar_pages.rhtml | 6 +++--- .../template/darkfish/_sidebar_table_of_contents.rhtml | 2 +- lib/rdoc/generator/template/darkfish/class.rhtml | 10 ++++++---- lib/rdoc/generator/template/darkfish/index.rhtml | 3 ++- lib/rdoc/generator/template/darkfish/page.rhtml | 1 + .../template/darkfish/servlet_not_found.rhtml | 3 ++- .../generator/template/darkfish/servlet_root.rhtml | 9 +++++---- .../template/darkfish/table_of_contents.rhtml | 10 ++++++---- test/rdoc/rdoc_generator_darkfish_test.rb | 2 +- 13 files changed, 36 insertions(+), 27 deletions(-) diff --git a/lib/rdoc/generator/template/darkfish/_footer.rhtml b/lib/rdoc/generator/template/darkfish/_footer.rhtml index 9791b42901..620cf01484 100644 --- a/lib/rdoc/generator/template/darkfish/_footer.rhtml +++ b/lib/rdoc/generator/template/darkfish/_footer.rhtml @@ -1,5 +1,5 @@ diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml index 067bd62edd..c4c6186b7c 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml @@ -3,11 +3,11 @@

Extended With Modules

diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml index 04846f84fb..74596647ac 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml @@ -5,9 +5,9 @@ diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml index faed7e0a94..26084d7f65 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml @@ -10,6 +10,7 @@ <%- else -%> <%= h name %> <%- end -%> + <%- end -%> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml index 3f68f0c0dc..cefafd0349 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml @@ -12,7 +12,7 @@ <%- end.each do |n, files| -%> <%- f = files.shift -%> <%- if files.empty? -%> -
  • <%= h f.page_name %> +
  • <%= h f.page_name %>
  • <%- next -%> <%- end -%>
  • open<% end %>><% @@ -23,9 +23,9 @@ end %> +
  • <%- end -%> diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml index b1e047b5f7..ac32362711 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml @@ -18,7 +18,7 @@ <%- while table.first && table.first.level >= level -%> <%- heading = table.shift -%> <%- if table.first.nil? || table.first.level <= heading.level -%> -
  • <% display_link.call heading -%> +
  • <% display_link.call heading -%>
  • <%- else -%>
  • diff --git a/lib/rdoc/generator/template/darkfish/class.rhtml b/lib/rdoc/generator/template/darkfish/class.rhtml index 628945d886..1cfff7055c 100644 --- a/lib/rdoc/generator/template/darkfish/class.rhtml +++ b/lib/rdoc/generator/template/darkfish/class.rhtml @@ -67,7 +67,7 @@
    <%- constants.each do |const| -%> -
    <%= const.name %> +
    <%= const.name %>
    <%- if const.comment then -%>
    <%- if const.mixin_from then -%> @@ -76,8 +76,9 @@ <%- end -%> <%= const.description.strip %> +
    <%- else -%> -
    (Not documented) +
    (Not documented)
    <%- end -%> <%- end -%>
    @@ -108,7 +109,7 @@ <%- if attrib.comment then -%> <%= attrib.description.strip %> <%- else -%> -

    (Not documented) +

    (Not documented)

    <%- end -%> @@ -179,7 +180,7 @@ <%- if method.comment then -%> <%= method.description.strip %> <%- else -%> -

    (Not documented) +

    (Not documented)

    <%- end -%> <%- if method.calls_super then -%>
    @@ -219,3 +220,4 @@ <%- end -%> + diff --git a/lib/rdoc/generator/template/darkfish/index.rhtml b/lib/rdoc/generator/template/darkfish/index.rhtml index beaab9570f..c00404c09e 100644 --- a/lib/rdoc/generator/template/darkfish/index.rhtml +++ b/lib/rdoc/generator/template/darkfish/index.rhtml @@ -18,6 +18,7 @@ <%- if @main_page %> <%= @main_page.description %> <%- else -%> -

    This is the API documentation for <%= h @title %>. +

    This is the API documentation for <%= h @title %>.

    <%- end -%> + diff --git a/lib/rdoc/generator/template/darkfish/page.rhtml b/lib/rdoc/generator/template/darkfish/page.rhtml index fb33eba6fd..a2386a40a7 100644 --- a/lib/rdoc/generator/template/darkfish/page.rhtml +++ b/lib/rdoc/generator/template/darkfish/page.rhtml @@ -16,3 +16,4 @@
    <%= file.description %>
    + diff --git a/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml b/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml index 098b589add..a7a63162e1 100644 --- a/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +++ b/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml @@ -16,5 +16,6 @@

    Not Found

    -

    <%= message %> +

    <%= message %>

    + diff --git a/lib/rdoc/generator/template/darkfish/servlet_root.rhtml b/lib/rdoc/generator/template/darkfish/servlet_root.rhtml index 373e0006d9..ea39dd6324 100644 --- a/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +++ b/lib/rdoc/generator/template/darkfish/servlet_root.rhtml @@ -20,7 +20,7 @@

    Local RDoc Documentation

    Here you can browse local documentation from the ruby standard library and - your installed gems. + your installed gems.

    <%- extra_dirs = installed.select { |_, _, _, type,| type == :extra } -%> <%- unless extra_dirs.empty? -%> @@ -50,16 +50,17 @@ You can install missing documentation for gems by running gem rdoc --all. After installing the missing documentation you only need to reload this page. The newly created documentation will - automatically appear. + automatically appear.

    You can also install documentation for a specific gem by running one of - the following commands. + the following commands.

      <%- names = missing.map { |name,| name.sub(/-([^-]*)$/, '') }.uniq -%> <%- names.each do |name| -%> -
    • gem rdoc <%=h name %> +
    • gem rdoc <%=h name %>
    • <%- end -%>
    <%- end -%> + diff --git a/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml b/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml index 2cd2207836..30014654a0 100644 --- a/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +++ b/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml @@ -25,9 +25,9 @@ table = file.parse(file.comment).table_of_contents unless table.empty? then %> <%- end -%>
  • @@ -48,7 +48,7 @@ <%- end -%> @@ -65,6 +65,8 @@ <%= h method.pretty_name %><%= method.parent.full_name %> + <%- end -%> + diff --git a/test/rdoc/rdoc_generator_darkfish_test.rb b/test/rdoc/rdoc_generator_darkfish_test.rb index 80c2bf0c44..fd13c8cc69 100644 --- a/test/rdoc/rdoc_generator_darkfish_test.rb +++ b/test/rdoc/rdoc_generator_darkfish_test.rb @@ -121,7 +121,7 @@ def test_generate klassnav ) assert_match( - %r[
  • \s*Heading 1.1.1.1\s*\s*\s*
  • ]m, + %r[
  • \s*Heading 1.1.1.1\s*
  • \s*\s*\s*]m, klassnav ) From 9b1cf05afee8b55ec8d94d3ee973654569958370 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Thu, 16 Oct 2025 14:51:23 +0100 Subject: [PATCH 2/4] Add Herb linter and fix ERB linting issues --- .vscode/extensions.json | 5 + .../generator/template/darkfish/_head.rhtml | 28 ++--- .../template/darkfish/_sidebar_extends.rhtml | 12 +- .../template/darkfish/_sidebar_includes.rhtml | 12 +- .../darkfish/_sidebar_installed.rhtml | 12 +- .../template/darkfish/_sidebar_methods.rhtml | 12 +- .../template/darkfish/_sidebar_pages.rhtml | 32 ++--- .../template/darkfish/_sidebar_parent.rhtml | 4 +- .../template/darkfish/_sidebar_sections.rhtml | 6 +- .../darkfish/_sidebar_table_of_contents.rhtml | 28 ++--- .../generator/template/darkfish/class.rhtml | 112 +++++++++--------- .../generator/template/darkfish/index.rhtml | 4 +- .../generator/template/darkfish/page.rhtml | 2 +- .../template/darkfish/servlet_root.rhtml | 31 +++-- .../template/darkfish/table_of_contents.rhtml | 30 ++--- 15 files changed, 167 insertions(+), 163 deletions(-) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000000..d49e5d015d --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "marcoroth.herb-lsp" + ] +} diff --git a/lib/rdoc/generator/template/darkfish/_head.rhtml b/lib/rdoc/generator/template/darkfish/_head.rhtml index 7376fc390e..eeae0acb03 100644 --- a/lib/rdoc/generator/template/darkfish/_head.rhtml +++ b/lib/rdoc/generator/template/darkfish/_head.rhtml @@ -1,34 +1,34 @@ - + <%= h @title %> -<%- if defined?(klass) -%> +<%- if defined?(klass) %> "> - <%- if klass.comment.empty? -%> + <%- if klass.comment.empty? %> "> - <%- else -%> + <%- else %> "> - <%- end -%> -<%- elsif defined?(file) -%> + <%- end %> +<%- elsif defined?(file) %> "> -<%- elsif @title -%> +<%- elsif @title %> <%- if @options.main_page and main_page = @files.find { |f| f.full_name == @options.main_page } then %> "> - <%- else -%> + <%- else %> - <%- end -%> -<%- end -%> + <%- end %> +<%- end %> -<%- if canonical_url = @options.canonical_root -%> +<%- if canonical_url = @options.canonical_root %> <% canonical_url = current.canonical_url if defined?(current) %> -<%- end -%> +<%- end %>