Module:documentation: Difference between revisions

m
1 revision imported
No edit summary
m (1 revision imported)
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:


local array_module = "Module:array"
local array_module = "Module:array"
local debug_track_module = "Module:debug/track"
local frame_module = "Module:frame"
local frame_module = "Module:frame"
local fun_is_callable_module = "Module:fun/isCallable"
local fun_is_callable_module = "Module:fun/isCallable"
Line 44: Line 45:
categorize_module = require(module_categorization_module).categorize
categorize_module = require(module_categorization_module).categorize
return categorize_module(...)
return categorize_module(...)
end
local function debug_track(...)
debug_track = require(debug_track_module)
return debug_track(...)
end
end


Line 163: Line 169:
["modern"    ] = "Modern";
["modern"    ] = "Modern";
}
}
local function track(page)
debug_track("documentation/" .. page)
return true
end


local function compare_pages(page1, page2, text)
local function compare_pages(page1, page2, text)
Line 751: Line 762:
-- obvious typos that should be corrected.
-- obvious typos that should be corrected.
if doc_page_content:lower():match("</?includeonly%f[%s/>][^>]*>") then
if doc_page_content:lower():match("</?includeonly%f[%s/>][^>]*>") then
track("module-includeonly")
else
else
-- Check for uses of {{module cat}}. find_templates treats the
-- Check for uses of {{module cat}}. find_templates treats the
Line 806: Line 818:
else
else
output:insert(
output:insert(
"<dd><i style=\"font-size: larger; color: #FF0000;\">Unable to auto-generate " ..
"<dd><i style=\"font-size: larger; color: var(--wikt-palette-red-9,#FF0000);\">Unable to auto-generate " ..
"documentation for this " .. pagetype ..".</i></dd>\n")
"documentation for this " .. pagetype ..".</i></dd>\n")
end
end
Line 928: Line 940:
local text_title = new_title(title.text)
local text_title = new_title(title.text)
if not (text_title and text_title.namespace == 2) then
if not (text_title and text_title.namespace == 2) then
track("sandbox to be moved")
local sandbox_of, diff = title.baseText
local sandbox_of, diff = title.baseText
if title_exists(sandbox_of) then
if title_exists(sandbox_of) then
diff = " (" .. compare_pages(title.fullText, sandbox_of, "diff") .. ")"
diff = " (" .. compare_pages(title.fullText, sandbox_of, "diff") .. ")"
else
track("no sandbox of")
end
end
Line 990: Line 1,005:
if title_exists(sandbox_of) then
if title_exists(sandbox_of) then
diff = " (" .. compare_pages(title.fullText, sandbox_of, "diff") .. ")"
diff = " (" .. compare_pages(title.fullText, sandbox_of, "diff") .. ")"
else
track("no sandbox of")
end
end
Line 1,040: Line 1,057:
end
end


output:insert(('\n<%s style="clear: both;" />'):format(args.hr == "below" and "hr" or "br"))
output:insert(('\n<%s style="clear: both;" />'):format(args.hr == "below" and "hr" or "span"))
if cats_auto_generated and not cats[1] and (not doc_content or not doc_content:find("%[%[Category:")) then
if cats_auto_generated and not cats[1] and (not doc_content or not doc_content:find("%[%[Category:")) then