* luci/contrib: fixed anchors in virtual module documentation, only render parameters to html which have a corresponding @param tag

This commit is contained in:
Jo-Philipp Wich 2008-08-09 16:36:16 +00:00
parent e4f0c97551
commit d8ed736906
2 changed files with 33 additions and 22 deletions

View file

@ -20,6 +20,7 @@ local luadoc = require"luadoc"
local package = package local package = package
local string = require"string" local string = require"string"
local table = require"table" local table = require"table"
local luciutil = require "luci.util"
module "luadoc.doclet.html" module "luadoc.doclet.html"
@ -137,6 +138,8 @@ function link_to (fname, doc, module_doc, file_doc, from, kind)
from = from or "" from = from or ""
kind = kind or "functions" kind = kind or "functions"
--luciutil.dumptable( module_doc )
if file_doc then if file_doc then
for _, func_name in pairs(file_doc[kind]) do for _, func_name in pairs(file_doc[kind]) do
if func_name == fname then if func_name == fname then
@ -145,6 +148,14 @@ function link_to (fname, doc, module_doc, file_doc, from, kind)
end end
end end
if module_doc and module_doc[kind] then
for func_name, tbl in pairs(module_doc[kind]) do
if func_name == fname then
return "#" .. fname
end
end
end
local _, _, modulename, fname = string.find(fname, "^(.-)[%.%:]?([^%.%:]*)$") local _, _, modulename, fname = string.find(fname, "^(.-)[%.%:]?([^%.%:]*)$")
assert(fname) assert(fname)

View file

@ -55,7 +55,7 @@ local function check_function (line)
return { return {
name = id, name = id,
private = (l == "local"), private = (l == "local"),
param = util.split("%s*,%s*", param), param = { } --util.split("%s*,%s*", param),
} }
end end
end) end)