From f576e5febf92b47c80db097c5f921889da466b89 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Sun, 8 Sep 2024 22:43:55 +0100 Subject: [PATCH] Make methods and attributes linkable --- .../generator/template/darkfish/class.rhtml | 24 ++++++++++++------- .../generator/template/darkfish/css/rdoc.css | 13 +++++++++- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/lib/rdoc/generator/template/darkfish/class.rhtml b/lib/rdoc/generator/template/darkfish/class.rhtml index 26652cada9..afac0c44cd 100644 --- a/lib/rdoc/generator/template/darkfish/class.rhtml +++ b/lib/rdoc/generator/template/darkfish/class.rhtml @@ -72,8 +72,10 @@ <%- attributes.each do |attrib| -%>
- <%= h attrib.name %>[<%= attrib.rw %>] + + <%= h attrib.name %> + [<%= attrib.rw %>] +
@@ -103,21 +105,27 @@ <%- if (call_seq = method.call_seq) then -%> <%- call_seq.strip.split("\n").each_with_index do |call_seq, i| -%> <%- end -%> <%- elsif method.has_call_seq? then -%>
- <%= h method.name %> + + <%= h method.name %> +
<%- else -%>
- <%= h method.name %> - <%= h method.param_seq %> + + <%= h method.name %> + <%= h method.param_seq %> +
<%- end -%>
diff --git a/lib/rdoc/generator/template/darkfish/css/rdoc.css b/lib/rdoc/generator/template/darkfish/css/rdoc.css index 09470a8ec9..12212a341e 100644 --- a/lib/rdoc/generator/template/darkfish/css/rdoc.css +++ b/lib/rdoc/generator/template/darkfish/css/rdoc.css @@ -631,6 +631,18 @@ main .method-heading { color: var(--text-color); } +main .method-heading::after { + content: 'ΒΆ'; + position: absolute; + visibility: hidden; + color: var(--secondary-color); + font-size: 0.5em; +} + +main .method-heading:hover::after { + visibility: visible; +} + main .method-controls { line-height: 20px; float: right; @@ -663,7 +675,6 @@ main #attribute-method-details .method-detail:hover { } main .attribute-access-type { text-transform: uppercase; - padding: 0 1em; } /* @end */