Module:documentation: Difference between revisions
No edit summary |
No edit summary |
||
| (4 intermediate revisions by 2 users 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 9: | Line 10: | ||
local module_categorization_module = "Module:module categorization" | local module_categorization_module = "Module:module categorization" | ||
local number_list_show_module = "Module:number list/show" | local number_list_show_module = "Module:number list/show" | ||
local chemical_element_list_show_module = "Module:chemical element list/show" | |||
local pages_module = "Module:pages" | local pages_module = "Module:pages" | ||
local parameters_module = "Module:parameters" | local parameters_module = "Module:parameters" | ||
| Line 44: | Line 46: | ||
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 109: | Line 116: | ||
number_list_show_table = require(number_list_show_module).table | number_list_show_table = require(number_list_show_module).table | ||
return number_list_show_table(...) | return number_list_show_table(...) | ||
end | |||
local function chemical_element_list_show_table(...) | |||
chemical_element_list_show_table = require(chemical_element_list_show_module).table | |||
return chemical_element_list_show_table(...) | |||
end | end | ||
| Line 163: | Line 175: | ||
["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 223: | Line 240: | ||
text = string.format( | text = string.format( | ||
"This data module contains the " .. text_type .. " of " .. | "This data module contains the " .. text_type .. " of " .. | ||
"[[Appendix:Unicode|Unicode]] code points within the range U+%04X to U+%04X.", | "[[wikt:Appendix:Unicode|Unicode]] code points within the range U+%04X to U+%04X.", | ||
low, high) | low, high) | ||
if subpage == "images" and safe_load_data("Module:Unicode data/emoji images/" .. first_three_of_code_point) then | if subpage == "images" and safe_load_data("Module:Unicode data/emoji images/" .. first_three_of_code_point) then | ||
| Line 387: | Line 404: | ||
end, | end, | ||
}, | }, | ||
{ | |||
regex = "^Module:chemical element list/data/(.+)$", | |||
process = function(title, cats, lang_code) | |||
local lang = insert_lang_data_module_cats(cats, lang_code, "Chemical element data modules") | |||
if lang then | |||
return ("This module contains data on chemical elements in %s.\n%s") | |||
:format(lang:makeCategoryLink(), chemical_element_list_show_table() or "") | |||
end | |||
end, | |||
}, | |||
{ | { | ||
regex = "^Module:accel/(.+)$", | regex = "^Module:accel/(.+)$", | ||
| Line 395: | Line 422: | ||
cats:insert(lang:getCanonicalName() .. " modules|accel") | cats:insert(lang:getCanonicalName() .. " modules|accel") | ||
cats:insert(("Accel submodules|%s"):format(lang:getCanonicalName())) | cats:insert(("Accel submodules|%s"):format(lang:getCanonicalName())) | ||
return ("This module contains new entry creation rules for %s; see [[WT:ACCEL]] for an overview, and [[Module:accel]] for information on creating new rules.") | return ("This module contains new entry creation rules for %s; see [[wikt:WT:ACCEL|WT:ACCEL]] for an overview, and [[Module:accel]] for information on creating new rules.") | ||
:format(lang:makeCategoryLink()) | :format(lang:makeCategoryLink()) | ||
end | end | ||
| Line 451: | Line 478: | ||
.. "This module is part of the category tree system, which is a general framework for generating the " | .. "This module is part of the category tree system, which is a general framework for generating the " | ||
.. "descriptions and categorization of category pages.\n\n" | .. "descriptions and categorization of category pages.\n\n" | ||
.. "For more information, see [[wikt:Module:category tree/lang/documentation]].\n\n" | .. "For more information, see [[wikt:Module:category tree/lang/documentation|Module:category tree/lang/documentation]].\n\n" | ||
.. "'''NOTE:''' If you add a new language-specific module, you must add the language code to the " | .. "'''NOTE:''' If you add a new language-specific module, you must add the language code to the " | ||
.. "list at the top of [[ | .. "list at the top of [[Module:category tree/lang]] in order for the module to be recognized." | ||
end | end | ||
end | end | ||
| Line 502: | Line 529: | ||
local lang, langname = insert_lang_data_module_cats(cats, lang_code, "Swadesh modules") | local lang, langname = insert_lang_data_module_cats(cats, lang_code, "Swadesh modules") | ||
if lang then | if lang then | ||
return "This module contains the [[Swadesh list]] of basic vocabulary in " .. langname .. "." | return "This module contains the [[wikt:Swadesh list|Swadesh list]] of basic vocabulary in " .. langname .. "." | ||
end | end | ||
end | end | ||
| Line 511: | Line 538: | ||
local lang, langname = insert_lang_data_module_cats(cats, lang_code, "Swadesh modules") | local lang, langname = insert_lang_data_module_cats(cats, lang_code, "Swadesh modules") | ||
if lang then | if lang then | ||
local prefix = "This module contains the [[Swadesh list]] of basic vocabulary in the " | local prefix = "This module contains the [[wikt:Swadesh list|Swadesh list]] of basic vocabulary in the " | ||
local etym_lang = get_lang(variety, nil, "allow etym") | local etym_lang = get_lang(variety, nil, "allow etym") | ||
if etym_lang then | if etym_lang then | ||
| Line 654: | Line 681: | ||
cats:insert("Reference modules") | cats:insert("Reference modules") | ||
return "This module holds bibliographical data for " .. | return "This module holds bibliographical data for " .. | ||
page .. ". For the formatted bibliography see '''[[Appendix:Bibliography/" .. page .. "]]'''." | page .. ". For the formatted bibliography see '''[[wikt:Appendix:Bibliography/" .. page .. "|Appendix:Bibliography/" .. page .. "]]'''." | ||
end, | end, | ||
}, | }, | ||
| Line 805: | Line 832: | ||
-- 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 992: | Line 1,020: | ||
local sandbox_of = title.text:match("^(.*)/sandbox%d*%f[/%z]") | local sandbox_of = title.text:match("^(.*)/sandbox%d*%f[/%z]") | ||
if sandbox_of then | if sandbox_of then | ||
track("sandbox to be moved") | |||
else | else | ||
sandbox_of = title.text:match("^sandbox%d*/(.*)$") | sandbox_of = title.text:match("^sandbox%d*/(.*)$") | ||
| Line 1,002: | Line 1,031: | ||
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,059: | Line 1,090: | ||
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 | ||