Merge pull request #223 from thehunmonkgroup/custom-css-config

add custom_css configuration param
This commit is contained in:
Steve J Donovan 2016-06-18 17:38:39 +02:00 committed by GitHub
commit 0d9768e86d
3 changed files with 12 additions and 1 deletions

View File

@ -238,6 +238,7 @@ local ldoc_contents = {
'unqualified', 'custom_display_name_handler', 'kind_names', 'custom_references',
'dont_escape_underscore','global_lookup','prettify_files','convert_opt', 'user_keywords',
'postprocess_html',
'custom_css',
}
ldoc_contents = tablex.makeset(ldoc_contents)

View File

@ -296,7 +296,7 @@ function ldoc.source_ref (fun)
return cleanup_whitespaces(out)
end
local css = ldoc.css
local css, custom_css = ldoc.css, ldoc.custom_css
ldoc.output = args.output
ldoc.ipairs = ipairs
ldoc.pairs = pairs
@ -329,6 +329,10 @@ function ldoc.source_ref (fun)
check_file(args.dir..css, path.join(args.style,css))
end
if custom_css then -- has custom CSS been copied?
check_file(args.dir..custom_css, custom_css)
end
-- write out the module index
out = cleanup_whitespaces(out)
writefile(args.dir..args.output..args.ext,out)
@ -349,6 +353,9 @@ function ldoc.source_ref (fun)
if css then
ldoc.css = '../'..css
end
if custom_css then
ldoc.custom_css = '../'..custom_css
end
for m in mods:iter() do
local kind, lkind, modules = unpack(m)
check_directory(args.dir..lkind)

View File

@ -6,6 +6,9 @@ return [==[
<head>
<title>$(ldoc.title)</title>
<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>
<body>