Merge branch 'master' of github.com:stevedonovan/LDoc
Steve Donovan
10 years ago
20 | 20 |
-- - 'N' tags which have no associated value, like 'local` (TAG_FLAG)
|
21 | 21 |
-- - 'T' tags which represent a type, like 'function' (TAG_TYPE)
|
22 | 22 |
local known_tags = {
|
23 | |
param = 'M', see = 'M', usage = 'ML', ['return'] = 'M', field = 'M', author='M';
|
|
23 |
param = 'M', see = 'M', usage = 'ML', ['return'] = 'M', field = 'M', author='M',set='M';
|
24 | 24 |
class = 'id', name = 'id', pragma = 'id', alias = 'id', within = 'id',
|
25 | 25 |
copyright = 'S', summary = 'S', description = 'S', release = 'S', license = 'S',
|
26 | 26 |
fixme = 'S', todo = 'S', warning = 'S', raise = 'S', charset = 'S',
|
|
625 | 625 |
local names = List()
|
626 | 626 |
self.subparams = {}
|
627 | 627 |
for i,name in ipairs(original_names) do
|
|
628 |
if type(name) ~= 'string' then
|
|
629 |
self:error("declared table cannot have array entries")
|
|
630 |
end
|
628 | 631 |
local pname,field = split_iden(name)
|
629 | 632 |
if field then
|
630 | 633 |
if not fields then
|
17 | 17 |
local path = require 'pl.path'
|
18 | 18 |
local stringx = require 'pl.stringx'
|
19 | 19 |
local template = require 'pl.template'
|
|
20 |
local tablex = require 'pl.tablex'
|
20 | 21 |
local tools = require 'ldoc.tools'
|
21 | 22 |
local markup = require 'ldoc.markup'
|
22 | 23 |
local prettify = require 'ldoc.prettify'
|
|
54 | 55 |
|
55 | 56 |
function html.generate_output(ldoc, args, project)
|
56 | 57 |
local check_directory, check_file, writefile = tools.check_directory, tools.check_file, tools.writefile
|
|
58 |
local original_ldoc
|
|
59 |
|
|
60 |
local function save_ldoc ()
|
|
61 |
if not original_ldoc then
|
|
62 |
original_ldoc = tablex.copy(ldoc)
|
|
63 |
end
|
|
64 |
end
|
|
65 |
|
|
66 |
local function restore_ldoc ()
|
|
67 |
if original_ldoc then
|
|
68 |
ldoc = original_ldoc
|
|
69 |
end
|
|
70 |
end
|
57 | 71 |
|
58 | 72 |
function ldoc.escape(str)
|
59 | 73 |
return (str:gsub("['&<>\"]", escape_table))
|
|
235 | 249 |
for m in modules() do
|
236 | 250 |
ldoc.module = m
|
237 | 251 |
ldoc.body = m.body
|
|
252 |
if m.tags.set then
|
|
253 |
save_ldoc()
|
|
254 |
for s in m.tags.set:iter() do
|
|
255 |
local var,val = s:match('([^=]+)=(.+)')
|
|
256 |
print('setting',var,val)
|
|
257 |
ldoc[var] = val
|
|
258 |
end
|
|
259 |
end
|
238 | 260 |
set_charset(ldoc)
|
239 | 261 |
m.info = get_module_info(m)
|
240 | 262 |
if ldoc.body and m.postprocess then
|
|
250 | 272 |
out = cleanup_whitespaces(out)
|
251 | 273 |
writefile(args.dir..lkind..'/'..m.name..args.ext,out)
|
252 | 274 |
end
|
|
275 |
restore_ldoc()
|
253 | 276 |
end
|
254 | 277 |
end
|
255 | 278 |
if not args.quiet then print('output written to '..tools.abspath(args.dir)) end
|