doc(@hidden;ldoc.ltp): Add ldoc tag to hide item

Add a new ldoc tag `@hidden`. This tag allows us to keep documentation
for magic methods (e.g. `wibox.widget.base:get_visible`) but prevent
it from being part of the documentation used by final users.
This commit is contained in:
Aire-One 2021-03-28 18:19:08 +02:00
parent 20a8d902c5
commit af3b194a31
2 changed files with 15 additions and 6 deletions

View File

@ -462,7 +462,16 @@ add_custom_tag {
-- @supermodule supermodule
add_custom_tag {
name = "supermodule",
hiden = true,
hidden = true,
auto_subtags = false
}
-- Mark the item ad hidden.
-- This tag should be used to hide items from the documentation.
-- @hidden
add_custom_tag {
name = "hidden",
hidden = true,
auto_subtags = false
}

View File

@ -72,7 +72,7 @@
# for kind,items in module.kinds() do
# local myitems = {}
# for item in items() do
# myitems[#myitems + 1] = item
# myitems[#myitems + 1] = item
# end
# all_module_kinds[#all_module_kinds + 1] = { kind = kind, items = myitems }
# end
@ -257,7 +257,7 @@
<h2><a href="#$(no_spaces(kind))">$(kind)</a></h2>
<table class="function_list">
# end
# for item in iter(k.items) do
# for item in iter(k.items) do if not item.tags.hidden then
# local dn = display_name(item)
# local inherited = item.inherited or (item.baseclass ~= module.name)
# if item.sanitize_type then item.sanitize_type(item, ldoc) end
@ -280,7 +280,7 @@
</td>
# end
</tr>
# end -- for items
# end end -- for items
# last_kind = kind
#end -- for kinds
</table>
@ -319,7 +319,7 @@
# if not kind:match("^ldoc_skip") then
<dl class="function">
# end
# for item in iter(k.items) do
# for item in iter(k.items) do if not item.tags.hidden then
<dt>
<a name = "$(item.name)"></a>
<strong>$(display_name(item))</strong>
@ -479,7 +479,7 @@
</span>
</dd>
# end -- for items
# end end -- for items
# last_kind = kind
# end -- for kinds
</dl>