From 89a02ac6cd6577fd67fc65d058dd6da32dc4d5fb Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Thu, 6 Jun 2019 01:02:31 -0400 Subject: [PATCH] doc: Standardize the function name. There was some issues like `gears.shape.circle` being called `module.circle`. There is also a disparity between how the constructor and "normal" functions are called. This commit attempts to force everything to have the full module name. --- docs/config.ld | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/config.ld b/docs/config.ld index 790237af..dc4173f7 100644 --- a/docs/config.ld +++ b/docs/config.ld @@ -169,6 +169,20 @@ custom_display_name_handler = function(item, default_handler) -- just redundant. ret = ret:gsub("([^:]*)(:[^:])","%2") + -- Undocumented API to get rid of `module.rounded_rect` rather than + -- `gears.shape.rounded_rect` + if ret:sub(1, 7) == "module." and module then + return ret:gsub("^module", item.module.name) + end + + -- Undocumented API to make the libraries and classmod "function" section + -- more consistent. Right now some have their full awful.foo.bar while other + -- have "just" `bar`. Given we use constructors from metatables, we have no + -- choice but to use the full function name. It also makes copy/paste easier. + if item.type == "function" and (not ret:find(".", 1, true)) and (not ret:find(":", 1, true)) then + return item.module.name .. "." .. ret + end + return ret end