diff --git a/docs/config.ld b/docs/config.ld index a48f7b05..3ac6d98f 100644 --- a/docs/config.ld +++ b/docs/config.ld @@ -178,10 +178,24 @@ local function wrap_modname(str, item) .. str:sub(#item.module.name+2, 9999) end +local named_args = { + [ "(args)" ] = true, + [ "([args=nil])" ] = true, + [ "([args={}])" ] = true +} + -- Wrap the arguments for the CSS highlight. local function wrap_args(item) if not item.args then return "" end - return ""..item.args.."" + + -- Display named args with `{}` and ordered args with `()` + if named_args[item.args] then + return "{[args]}" + end + + local new_args = item.args:sub(2, item.args:len()-2) + + return " ("..new_args..")" end diff --git a/docs/ldoc.css b/docs/ldoc.css index 2355bf2c..3e395641 100644 --- a/docs/ldoc.css +++ b/docs/ldoc.css @@ -315,6 +315,25 @@ table.function_list .function_args /*.function_modname*/ { text-decoration-color: #bbd3ff; } +table.function_list .function_args b { + font-weight: 500; + color: #95b1ff; + text-decoration: underline; + text-decoration-color: #bbd3ff; +} + +table.function_list .function_named_args b { + color: #b37cff; + text-decoration: underline; + text-decoration-color: #bbd3ff; +} + +table.function_list .function_named_args { + color: #ba97ff; + text-decoration: underline; + text-decoration-color: #bbd3ff; +} + dl.function { margin-right: 15px; margin-left: 15px;