doc: Update the template to render sub-tags.

Sub-tags are a new concept and is equivalent to @tparam, but in
a generic form.
This commit is contained in:
Emmanuel Lepage Vallee 2019-11-24 03:59:38 -05:00
parent a6add4dab6
commit 4102e6a503
1 changed files with 30 additions and 15 deletions

View File

@ -204,21 +204,6 @@
<dd>
$(M(ldoc.descript(item),item))
# if ldoc.custom_tags then
# for custom in iter(ldoc.custom_tags) do
# local tag = item.tags[custom[1]]
# if tag and not custom.hidden then
# local li,il = use_li(tag)
<h3>$(custom.title or custom[1]):</h3>
<ul>
# for value in iter(tag) do
$(li)$(custom.format and custom.format(value) or M(value))$(il)
# end -- for
# end -- if tag
</ul>
# end -- iter tags
# end
# if show_parms and item.params and #item.params > 0 and not item.hide_params then
# local subnames = module.kinds:type_of(item).subnames
# if subnames then
@ -307,6 +292,36 @@
</ul>
# end -- if usage
# if ldoc.custom_tags then
# for custom in iter(ldoc.custom_tags) do
# local tag = item.tags[custom[1]]
# if tag and not custom.hidden then
# local group_begin, group_end, row_type_begin, row_type_end, group_header = item.get_delim(custom[1])
<h3>$(custom.title or custom[1]):</h3>
<$(group_begin)>
# if group_header then
<tr style='font-weight: bold;'>
# for _, g in ldoc.ipairs(group_header) do
<th>$(g)</th>
# end -- for g
</tr>
# end -- if group_header then
# for value in iter(tag) do
<$(row_type_begin)>$(custom.format and custom.format(value, item, M) or M(value))</$(row_type_end)>
# local sub_values, sub_custom = item.get_auto_params(custom[1], value)
# if sub_values then
<ul>
# for _, value in ldoc.ipairs(sub_values) do
<li>$(sub_custom.format(value, item, M))</li>
# end -- for auto_params
</ul>
# end -- if item.auto_params
# end -- for
</$(group_end)>
# end -- if tag
# end -- iter tags
# end -- ldoc.custom_tags
</dd>
# end -- for items
# last_kind = kind