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:
Mooffie 2014-12-14 16:30:50 +02:00
parent 4ab5f07d84
commit fc768df17e
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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