From fc768df17e3e5205737aeb87c5f152435cc9a633 Mon Sep 17 00:00:00 2001 From: Mooffie Date: Sun, 14 Dec 2014 16:30:50 +0200 Subject: [PATCH] Make custom_display_name work for project-level items This lets users customize the way module/topic/file/etc names are shown. --- ldoc/html.lua | 5 +++++ ldoc/html/ldoc_ltp.lua | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ldoc/html.lua b/ldoc/html.lua index ee54e1d..fb8b94c 100644 --- a/ldoc/html.lua +++ b/ldoc/html.lua @@ -176,6 +176,11 @@ function ldoc.source_ref (fun) end 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 if item.type == 'function' or item.type == 'lfunction' then if not ldoc.no_space_before_args then diff --git a/ldoc/html/ldoc_ltp.lua b/ldoc/html/ldoc_ltp.lua index 07c8a84..e87cbdb 100644 --- a/ldoc/html/ldoc_ltp.lua +++ b/ldoc/html/ldoc_ltp.lua @@ -66,7 +66,7 @@ return [==[ # if ldoc.allowed_in_contents(type,module) then

$(kind)