From a6edec05b786aed084b536bdeeb33dcd1387d547 Mon Sep 17 00:00:00 2001 From: Petrik Date: Fri, 2 Jun 2023 16:10:26 +0200 Subject: [PATCH] Add permalinks to attributes Attributes support the aref attribute so we can add permalinks to attributes. --- lib/rdoc/generator/template/rails/_context.rhtml | 3 ++- lib/rdoc/generator/template/rails/resources/css/main.css | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/rdoc/generator/template/rails/_context.rhtml b/lib/rdoc/generator/template/rails/_context.rhtml index f35fcd8e..85db6e81 100644 --- a/lib/rdoc/generator/template/rails/_context.rhtml +++ b/lib/rdoc/generator/template/rails/_context.rhtml @@ -108,7 +108,7 @@ <% unless attributes.empty? %>

Attributes

- +
<% attributes.each do |attrib| %> + <% end %>
@@ -116,6 +116,7 @@ <%= h attrib.name %> <%= attrib.description.strip %>
diff --git a/lib/rdoc/generator/template/rails/resources/css/main.css b/lib/rdoc/generator/template/rails/resources/css/main.css index c2564735..8d47f1ed 100644 --- a/lib/rdoc/generator/template/rails/resources/css/main.css +++ b/lib/rdoc/generator/template/rails/resources/css/main.css @@ -279,6 +279,10 @@ pre .attr-desc { } +.attr-link { + position: relative; +} + tt { font-size: 1.15em; } @@ -342,7 +346,7 @@ tt { position: relative; } -.method a.permalink { +.method a.permalink, .attr-link a.permalink { position: absolute; font-size: 0.9em; right: 0;