From b9803db8ffc3999776384a448373d40d941f1d8e Mon Sep 17 00:00:00 2001 From: cjtallman Date: Fri, 16 Oct 2015 13:34:31 -0700 Subject: [PATCH] Adding module-level see reference support. --- ldoc/doc.lua | 8 +++++++- ldoc/html/ldoc_ltp.lua | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ldoc/doc.lua b/ldoc/doc.lua index e4fce52..05474e8 100644 --- a/ldoc/doc.lua +++ b/ldoc/doc.lua @@ -1198,7 +1198,8 @@ end -- and try to to resolve this. function Module:resolve_references(modules) local found = List() - for item in self.items:iter() do + -- Resolve see references in item. Can be Module or Item type. + local function resolve_item_references(item) local see = item.tags.see if see then -- this guy has @see references item.see = List() @@ -1213,6 +1214,11 @@ function Module:resolve_references(modules) end end end + + resolve_item_references(self); -- Resolve module-level see references. + for item in self.items:iter() do + resolve_item_references(item); -- Resolve item-level see references. + end -- mark as found, so we don't waste time re-searching for f in found:iter() do f[1].tags.see:remove_value(f[2]) diff --git a/ldoc/html/ldoc_ltp.lua b/ldoc/html/ldoc_ltp.lua index e5a081f..52247dc 100644 --- a/ldoc/html/ldoc_ltp.lua +++ b/ldoc/html/ldoc_ltp.lua @@ -90,6 +90,15 @@ return [==[ # if module.tags.include then $(M(ldoc.include_file(module.tags.include))) # end +# if module.see then +# local li,il = use_li(module.see) +

See also:

+ +# end -- if see # if module.usage then # local li,il = use_li(module.usage)

Usage: