diff --git a/ldoc.lua b/ldoc.lua index c4c0bf6..3ffe199 100644 --- a/ldoc.lua +++ b/ldoc.lua @@ -236,6 +236,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) diff --git a/ldoc/html.lua b/ldoc/html.lua index 9e135da..d1eb888 100644 --- a/ldoc/html.lua +++ b/ldoc/html.lua @@ -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) diff --git a/ldoc/html/ldoc_ltp.lua b/ldoc/html/ldoc_ltp.lua index 52247dc..0bafabf 100644 --- a/ldoc/html/ldoc_ltp.lua +++ b/ldoc/html/ldoc_ltp.lua @@ -6,6 +6,9 @@ return [==[ $(ldoc.title) +# if ldoc.custom_css then -- add custom CSS file if configured. + +# end