diff --git a/docs/config.ld b/docs/config.ld index 854a223e9..ca66ae967 100644 --- a/docs/config.ld +++ b/docs/config.ld @@ -265,6 +265,15 @@ local display_type = { deprecatedproperty = true, } +-- Show return values. +local show_return = { + ["function"] = true, + constructorfct = true, + staticfct = true, + method = true, + deprecated = true, +} + custom_display_name_handler = function(item, default_handler) local ret = default_handler(item) @@ -274,6 +283,12 @@ custom_display_name_handler = function(item, default_handler) item.sanitize_type = sanitize_type end + -- LDoc hardcode the "Returns" section for "function" only, fix that. + if show_return[item.type] and item.tags["return"] then + item.ret = item.tags["return"] + item:build_return_groups() + end + -- Remove the "namespace" from the signals and properties if no_prefix[item.type] then local name = item.name:match("%.([^.]+)$")