From 8e099cfda5a9bb873a6dd159183973c54884c16f Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Tue, 22 Aug 2023 04:15:37 -0700 Subject: [PATCH] doc: Fix the @property handling for @classmod. Previously, things like `awful.screenshot` would print a false positive warning because the `item.name` was fixed after the linting rather than before it. --- docs/config.ld | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/docs/config.ld b/docs/config.ld index 64ac650c5..1c9f39860 100644 --- a/docs/config.ld +++ b/docs/config.ld @@ -1739,6 +1739,13 @@ local summarize = { readonly = {index = 8, title = "read only" , count = false}, } +local no_prefix = { + property = true, + signal = true, + clientruleproperty = true, + deprecatedproperty = true, +} + local delimiter_for_tag = { usebeautiful = { "table class='widget_list' border=1", "table", "tr", "tr", {"Theme variable", "Usage"}}, propbeautiful = { "table class='widget_list' border=1", "table", "tr", "tr", {"Theme variable", "Usage"}}, @@ -2126,7 +2133,11 @@ local function global_init(_ldoc) -- Decorate the item with our customizations. init_custom_types(item) - -- print(item.description) + -- Remove the "namespace" from the signals and properties + if no_prefix[item.type] then + local name = item.name:match("%.([^.]+)$") + item.name = name ~= "" and name or item.name + end if item.summary and not detect_markdown_footguns(item.summary) then print( @@ -2247,13 +2258,6 @@ local function compare_module_name(input, module) return false end -local no_prefix = { - property = true, - signal = true, - clientruleproperty = true, - deprecatedproperty = true, -} - -- These modules merge the doc of their `awful` siblings. local coreclassmap = { tag = "tag and awful.tag", @@ -2366,12 +2370,6 @@ custom_display_name_handler = function(item, default_handler) item:build_return_groups() end - -- Remove the "namespace" from the signals and properties - if no_prefix[item.type] then - local name = item.name:match("%.([^.]+)$") - return name ~= "" and name or item.name - end - -- Handle the left sidebar modules. if item.type == "coreclassmod" and coreclassmap[item.name] then return coreclassmap[item.name]