add custom_css configuration param.
This commit is contained in:
parent
aa4cd9daf8
commit
d8ff44f626
1
ldoc.lua
1
ldoc.lua
|
@ -236,6 +236,7 @@ local ldoc_contents = {
|
||||||
'unqualified', 'custom_display_name_handler', 'kind_names', 'custom_references',
|
'unqualified', 'custom_display_name_handler', 'kind_names', 'custom_references',
|
||||||
'dont_escape_underscore','global_lookup','prettify_files','convert_opt', 'user_keywords',
|
'dont_escape_underscore','global_lookup','prettify_files','convert_opt', 'user_keywords',
|
||||||
'postprocess_html',
|
'postprocess_html',
|
||||||
|
'custom_css',
|
||||||
}
|
}
|
||||||
ldoc_contents = tablex.makeset(ldoc_contents)
|
ldoc_contents = tablex.makeset(ldoc_contents)
|
||||||
|
|
||||||
|
|
|
@ -296,7 +296,7 @@ function ldoc.source_ref (fun)
|
||||||
return cleanup_whitespaces(out)
|
return cleanup_whitespaces(out)
|
||||||
end
|
end
|
||||||
|
|
||||||
local css = ldoc.css
|
local css, custom_css = ldoc.css, ldoc.custom_css
|
||||||
ldoc.output = args.output
|
ldoc.output = args.output
|
||||||
ldoc.ipairs = ipairs
|
ldoc.ipairs = ipairs
|
||||||
ldoc.pairs = pairs
|
ldoc.pairs = pairs
|
||||||
|
@ -329,6 +329,10 @@ function ldoc.source_ref (fun)
|
||||||
check_file(args.dir..css, path.join(args.style,css))
|
check_file(args.dir..css, path.join(args.style,css))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if custom_css then -- has custom CSS been copied?
|
||||||
|
check_file(args.dir..custom_css, custom_css)
|
||||||
|
end
|
||||||
|
|
||||||
-- write out the module index
|
-- write out the module index
|
||||||
out = cleanup_whitespaces(out)
|
out = cleanup_whitespaces(out)
|
||||||
writefile(args.dir..args.output..args.ext,out)
|
writefile(args.dir..args.output..args.ext,out)
|
||||||
|
@ -349,6 +353,9 @@ function ldoc.source_ref (fun)
|
||||||
if css then
|
if css then
|
||||||
ldoc.css = '../'..css
|
ldoc.css = '../'..css
|
||||||
end
|
end
|
||||||
|
if custom_css then
|
||||||
|
ldoc.custom_css = '../'..custom_css
|
||||||
|
end
|
||||||
for m in mods:iter() do
|
for m in mods:iter() do
|
||||||
local kind, lkind, modules = unpack(m)
|
local kind, lkind, modules = unpack(m)
|
||||||
check_directory(args.dir..lkind)
|
check_directory(args.dir..lkind)
|
||||||
|
|
|
@ -6,6 +6,9 @@ return [==[
|
||||||
<head>
|
<head>
|
||||||
<title>$(ldoc.title)</title>
|
<title>$(ldoc.title)</title>
|
||||||
<link rel="stylesheet" href="$(ldoc.css)" type="text/css" />
|
<link rel="stylesheet" href="$(ldoc.css)" type="text/css" />
|
||||||
|
# if ldoc.custom_css then -- add custom CSS file if configured.
|
||||||
|
<link rel="stylesheet" href="$(ldoc.custom_css)" type="text/css" />
|
||||||
|
# end
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue