Adding module-level see reference support.
This commit is contained in:
parent
fe15020f76
commit
b9803db8ff
|
@ -1198,7 +1198,8 @@ end
|
||||||
-- and try to to resolve this.
|
-- and try to to resolve this.
|
||||||
function Module:resolve_references(modules)
|
function Module:resolve_references(modules)
|
||||||
local found = List()
|
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
|
local see = item.tags.see
|
||||||
if see then -- this guy has @see references
|
if see then -- this guy has @see references
|
||||||
item.see = List()
|
item.see = List()
|
||||||
|
@ -1213,6 +1214,11 @@ function Module:resolve_references(modules)
|
||||||
end
|
end
|
||||||
end
|
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
|
-- mark as found, so we don't waste time re-searching
|
||||||
for f in found:iter() do
|
for f in found:iter() do
|
||||||
f[1].tags.see:remove_value(f[2])
|
f[1].tags.see:remove_value(f[2])
|
||||||
|
|
|
@ -90,6 +90,15 @@ return [==[
|
||||||
# if module.tags.include then
|
# if module.tags.include then
|
||||||
$(M(ldoc.include_file(module.tags.include)))
|
$(M(ldoc.include_file(module.tags.include)))
|
||||||
# end
|
# end
|
||||||
|
# if module.see then
|
||||||
|
# local li,il = use_li(module.see)
|
||||||
|
<h3>See also:</h3>
|
||||||
|
<ul>
|
||||||
|
# for see in iter(module.see) do
|
||||||
|
$(li)<a href="$(ldoc.href(see))">$(see.label)</a>$(il)
|
||||||
|
# end -- for
|
||||||
|
</ul>
|
||||||
|
# end -- if see
|
||||||
# if module.usage then
|
# if module.usage then
|
||||||
# local li,il = use_li(module.usage)
|
# local li,il = use_li(module.usage)
|
||||||
<h3>Usage:</h3>
|
<h3>Usage:</h3>
|
||||||
|
|
Loading…
Reference in New Issue