Make custom_display_name work for project-level items
This lets users customize the way module/topic/file/etc names are shown.
This commit is contained in:
parent
4ab5f07d84
commit
fc768df17e
|
@ -176,6 +176,11 @@ function ldoc.source_ref (fun)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ldoc.default_display_name(item)
|
function ldoc.default_display_name(item)
|
||||||
|
-- Project-level items:
|
||||||
|
if doc.project_level(item.type) then
|
||||||
|
return ldoc.module_name(item)
|
||||||
|
end
|
||||||
|
-- Module-level items:
|
||||||
local name = item.display_name or item.name
|
local name = item.display_name or item.name
|
||||||
if item.type == 'function' or item.type == 'lfunction' then
|
if item.type == 'function' or item.type == 'lfunction' then
|
||||||
if not ldoc.no_space_before_args then
|
if not ldoc.no_space_before_args then
|
||||||
|
|
|
@ -66,7 +66,7 @@ return [==[
|
||||||
# if ldoc.allowed_in_contents(type,module) then
|
# if ldoc.allowed_in_contents(type,module) then
|
||||||
<h2>$(kind)</h2>
|
<h2>$(kind)</h2>
|
||||||
<ul class="$(kind=='Topics' and '' or 'nowrap'">
|
<ul class="$(kind=='Topics' and '' or 'nowrap'">
|
||||||
# for mod in mods() do local name = ldoc.module_name(mod)
|
# for mod in mods() do local name = display_name(mod)
|
||||||
# if mod.name == this_mod then
|
# if mod.name == this_mod then
|
||||||
<li><strong>$(name)</strong></li>
|
<li><strong>$(name)</strong></li>
|
||||||
# else
|
# else
|
||||||
|
|
Loading…
Reference in New Issue