can now use package field in config.ld. tests/luadoc contains a suitable setup for processing LuaDoc itself correctly
This commit is contained in:
parent
5387084565
commit
f2fc6f1604
27
ldoc.lua
27
ldoc.lua
|
@ -373,18 +373,21 @@ end
|
||||||
-- * 'NAME' explicitly give the base module package name
|
-- * 'NAME' explicitly give the base module package name
|
||||||
--
|
--
|
||||||
|
|
||||||
if args.package == '.' then
|
local function setup_package_base()
|
||||||
args.package = source_dir
|
if ldoc.package then args.package = ldoc.package end
|
||||||
elseif args.package == '..' then
|
if args.package == '.' then
|
||||||
args.package = path.splitpath(source_dir)
|
|
||||||
elseif not args.package:find '[\//]' then
|
|
||||||
local subdir,dir = path.splitpath(source_dir)
|
|
||||||
if dir == args.package then
|
|
||||||
args.package = subdir
|
|
||||||
elseif path.isdir(path.join(source_dir,args.package)) then
|
|
||||||
args.package = source_dir
|
args.package = source_dir
|
||||||
else
|
elseif args.package == '..' then
|
||||||
quit("args.package is not the name of the source directory")
|
args.package = path.splitpath(source_dir)
|
||||||
|
elseif not args.package:find '[\//]' then
|
||||||
|
local subdir,dir = path.splitpath(source_dir)
|
||||||
|
if dir == args.package then
|
||||||
|
args.package = subdir
|
||||||
|
elseif path.isdir(path.join(source_dir,args.package)) then
|
||||||
|
args.package = source_dir
|
||||||
|
else
|
||||||
|
quit("args.package is not the name of the source directory")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -417,6 +420,7 @@ if path.isdir(args.file) then
|
||||||
if #config_files > 0 and not config_dir then
|
if #config_files > 0 and not config_dir then
|
||||||
config_dir = read_ldoc_config(config_files[1])
|
config_dir = read_ldoc_config(config_files[1])
|
||||||
end
|
end
|
||||||
|
setup_package_base()
|
||||||
|
|
||||||
for f in files:iter() do
|
for f in files:iter() do
|
||||||
local ext = path.extension(f)
|
local ext = path.extension(f)
|
||||||
|
@ -441,6 +445,7 @@ elseif path.isfile(args.file) then
|
||||||
read_ldoc_config(config)
|
read_ldoc_config(config)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
setup_package_base()
|
||||||
local ext = path.extension(args.file)
|
local ext = path.extension(args.file)
|
||||||
local ftype = file_types[ext]
|
local ftype = file_types[ext]
|
||||||
if not ftype then quit "unsupported extension" end
|
if not ftype then quit "unsupported extension" end
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
project = 'LuaDoc'
|
||||||
|
title = "LuaDoc with LDoc"
|
||||||
|
package = 'luadoc'
|
||||||
|
file = [[c:\users\steve\luadist\share\lua\lmod\luadoc]]
|
|
@ -1,5 +1,16 @@
|
||||||
-- this module has a comment.
|
--- this module has a comment.
|
||||||
-- But it's not a doc comment!
|
|
||||||
|
local local_two
|
||||||
|
|
||||||
|
--- a local function
|
||||||
|
local function local_one ()
|
||||||
|
end
|
||||||
|
|
||||||
|
--- a local function, needing explicit tag.
|
||||||
|
-- @local here
|
||||||
|
function local_two ()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
--- A problem function.
|
--- A problem function.
|
||||||
-- @param p a parameter
|
-- @param p a parameter
|
||||||
|
|
Loading…
Reference in New Issue