Add ldoc tags for inherited members.

* Add `@inheritedproperty`, `@inheritedmethod` and `@inheritedsignal` ldoc tags to specify inherited members in the documentation,
* These new tags create their own section in the rendered documentation,
* Implemente these tags for `docs/common/object.ldoc` and `docs/common/widget.ldoc`.
This commit is contained in:
Aire-One 2019-11-23 13:58:47 +01:00 committed by Emmanuel Lepage Vallee
parent a0386dad91
commit 46c86351a0
4 changed files with 33 additions and 8 deletions

View File

@ -59,7 +59,7 @@
--- Add a new `awful.button` to this widget.
-- @tparam awful.button button The button to add.
-- @function add_button
-- @method add_button
-- @baseclass wibox.widget
--- Emit a signal and ensure all parent widgets in the hierarchies also
@ -67,8 +67,8 @@
-- set of containers and layouts wrapping the widget.
-- @tparam string signal_name
-- @param ... Other arguments
-- @method emit_signal_recursive
-- @baseclass wibox.widget
-- @method emit_signal_recursive
--- When the layout (size) change.
-- This signal is emitted when the previous results of `:layout()` and `:fit()`

View File

@ -591,7 +591,6 @@ local function wrap_args(item)
return "<span class='function_args'> <b>(</b>"..new_args.."<b>)</b></span>"
end
-- Mimics the ldoc built-in method style, but better.
--
-- This custom renderer exists because using ldoc built-in method detection
@ -638,7 +637,9 @@ local function sanitize_type(item, ldoc)
item.display_type = "<span class='summary_type'>N/A</span>"
end
local no_prefix = {
property = true, signal = true, clientruleproperty = true,
property = true,
signal = true,
clientruleproperty = true,
deprecatedproperty = true,
}
@ -733,7 +734,6 @@ custom_display_name_handler = function(item, default_handler)
ret = render_methods(item)
end
-- Get rid of the "module:" in front of method names. It is either wrong or
-- just redundant.
ret = ret:gsub("([^:]*)(:[^:])","%2")

View File

@ -282,6 +282,7 @@ table.module_list td, table.function_list td {
table.module_list td.name, table.function_list td.name {
background-color: white;
min-width: 200px;
border-left-width: 0px;
border-right-width: 0px;
}
table.module_list td.summary, table.function_list td.summary {
@ -293,14 +294,28 @@ table.module_list td.summary, table.function_list td.summary {
table.function_list td.shortname {
background-color: white;
border-left-width: 0px;
border-right-width: 0px;
}
table.function_list td.inheritance {
background-color: white;
border-right-width: 0px;
border-left-width: 0px;
color: #a4c7ff;
min-width: 200px;
}
.proptype {
padding-right: 20px;
float: right;
}
span.inheritance {
color: #9db9f3;
font-weight: normal;
}
td.summarytype {
background-color: white;
color: #a4c7ff;
@ -402,6 +417,11 @@ ul.nowrap {
font-weight: normal;
}
/*.inheritedmethodparent {
color: #9db9f3;
font-weight: normal;
}*/
/* stop sublists from having initial vertical space */
ul ul { margin-top: 0px; }
ol ul { margin-top: 0px; }

View File

@ -161,12 +161,12 @@
# else
<td class="name" $(nowrap)><a href="#$(item.name)">$(dn)</a></td>
# end
<td class="summary">$(M(item.summary,item))</td>
<td class="baseclass" $(nowrap)>
<td colspan="$(item.inherited and 1 or 2)" class="summary">$(M(item.summary,item))</td>
# if item.inherited then
<td class="baseclass" $(nowrap)>
Inherited from $(item.baseclass)
# end
</td>
# end
</tr>
# end -- for items
# last_kind = kind
@ -210,6 +210,11 @@
<dt>
<a name = "$(item.name)"></a>
<strong>$(display_name(item))</strong>
# if item.display_inheritance then
<span class="inheritance">
&middot Inherited from
<a href="$(item.display_inheritance)">$(item.display_inheritance)</a>
# end
# if item.display_type then
<span class="proptype">($(item.display_type))</span>
# end