From 0aa9ba1ecd696241f40a155e357c1f7b5456f856 Mon Sep 17 00:00:00 2001 From: Antoine Marguerie Date: Fri, 18 Oct 2024 09:30:34 +0200 Subject: [PATCH] Add new RDoc feature: Render mixed-in methods and constants --- .../generator/template/rorvswild/class.rhtml | 19 ++++++++++++++++++- .../generator/template/rorvswild/css/rdoc.css | 6 ++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/rdoc/generator/template/rorvswild/class.rhtml b/lib/rdoc/generator/template/rorvswild/class.rhtml index a58fa82..24af365 100644 --- a/lib/rdoc/generator/template/rorvswild/class.rhtml +++ b/lib/rdoc/generator/template/rorvswild/class.rhtml @@ -30,7 +30,14 @@ <%- constants.each do |const| -%>
<%= const.name %>
<%- if const.comment then -%> -
<%= const.description.strip %>
+
+ <%- if const.mixin_from then -%> + + <%- end -%> + <%= const.description.strip %> +
<%- else -%>
(Not documented)
<%- end -%> @@ -54,6 +61,11 @@
+ <%- if attrib.mixin_from then -%> +
+ <%= attrib.singleton ? "Extended" : "Included" %> from <%= attrib.mixin_from.full_name %> +
+ <%- end -%> <%- if attrib.comment then -%> <%= attrib.description.strip %> <%- else -%> @@ -107,6 +119,11 @@ <%- unless method.skip_description? then -%>
+ <%- if method.mixin_from then -%> +
+ <%= method.singleton ? "Extended" : "Included" %> from <%= method.mixin_from.full_name %> +
+ <%- end -%> <%- if method.comment then -%> <%= method.description.strip %> <%- else -%> diff --git a/lib/rdoc/generator/template/rorvswild/css/rdoc.css b/lib/rdoc/generator/template/rorvswild/css/rdoc.css index 20c0a88..c82f983 100644 --- a/lib/rdoc/generator/template/rorvswild/css/rdoc.css +++ b/lib/rdoc/generator/template/rorvswild/css/rdoc.css @@ -736,6 +736,12 @@ pre + .toggle-source { margin-top: 0.5rem; } .method-description p { margin: 0; } .method-description ul { margin-left: 1.5em; } + +main .mixin-from { + font-size: 0.823em; + font-style: italic; + margin-bottom: 0.75em; +} #attribute-method-details .method-detail:hover { background-color: transparent;