Codebase list lua-ldoc / f2fc6f1
can now use package field in config.ld. tests/luadoc contains a suitable setup for processing LuaDoc itself correctly steve donovan 12 years ago
3 changed file(s) with 33 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
372372 -- * 'NAME' explicitly give the base module package name
373373 --
374374
375 if args.package == '.' then
376 args.package = source_dir
377 elseif args.package == '..' then
378 args.package = path.splitpath(source_dir)
379 elseif not args.package:find '[\//]' then
380 local subdir,dir = path.splitpath(source_dir)
381 if dir == args.package then
382 args.package = subdir
383 elseif path.isdir(path.join(source_dir,args.package)) then
375 local function setup_package_base()
376 if ldoc.package then args.package = ldoc.package end
377 if args.package == '.' then
384378 args.package = source_dir
385 else
386 quit("args.package is not the name of the source directory")
379 elseif args.package == '..' then
380 args.package = path.splitpath(source_dir)
381 elseif not args.package:find '[\//]' then
382 local subdir,dir = path.splitpath(source_dir)
383 if dir == args.package then
384 args.package = subdir
385 elseif path.isdir(path.join(source_dir,args.package)) then
386 args.package = source_dir
387 else
388 quit("args.package is not the name of the source directory")
389 end
387390 end
388391 end
389392
416419 if #config_files > 0 and not config_dir then
417420 config_dir = read_ldoc_config(config_files[1])
418421 end
422 setup_package_base()
419423
420424 for f in files:iter() do
421425 local ext = path.extension(f)
440444 read_ldoc_config(config)
441445 end
442446 end
447 setup_package_base()
443448 local ext = path.extension(args.file)
444449 local ftype = file_types[ext]
445450 if not ftype then quit "unsupported extension" end
0 project = 'LuaDoc'
1 title = "LuaDoc with LDoc"
2 package = 'luadoc'
3 file = [[c:\users\steve\luadist\share\lua\lmod\luadoc]]
0 -- this module has a comment.
1 -- But it's not a doc comment!
0 --- this module has a comment.
1
2 local local_two
3
4 --- a local function
5 local function local_one ()
6 end
7
8 --- a local function, needing explicit tag.
9 -- @local here
10 function local_two ()
11
12 end
213
314 --- A problem function.
415 -- @param p a parameter