Module:Dochead: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Ganaram inukshuk (talk | contribs)
Created page with "-- This module follows User:Ganaram inukshuk/Provisional style guide for Lua local getArgs = require("Module:Arguments").getArgs local ctg = require("Module:Category handler")._category_handler local p = {} -- Produces a hatnote that is placed on the top of a documentation page (either -- template or module documentation) and can autodetect and categorize: -- - FOR MODULES: -- - whether a module has an accompanying template (overridable) -- - whether a modu..."
 
Ganaram inukshuk (talk | contribs)
No edit summary
Line 18: Line 18:
-- - (MODULES) whether it's a metamodule (used the same way as a metatemplate,
-- - (MODULES) whether it's a metamodule (used the same way as a metatemplate,
--  but direct use of module code is allowed)
--  but direct use of module code is allowed)
-- Detect whether a page exists, where pagename is "Namespace:Title"
function p.page_exists(pagename)
local pagename = pagename or "Template:Dochead"
local title = mw.title.new(pagename)
if title and title.exists then
return true
else
return false
end
end


function p._dochead(args)
function p._dochead(args)
local pagename = args["pagename"]
local is_metause = args["is_metause"] or false

Revision as of 05:15, 28 October 2025

Module documentation[view] [edit] [history] [purge]
Module:Dochead is ready for use. This message indicates that a module is ready for use, or has recently been repaired. This message may be removed once this module has been used on several pages or once it is verified to work as intended.

Details: Functionally complete. Edge-case observations still ongoing. Links can now be viewed on /doc pages.

Introspection summary for Module:Dochead 
Functions provided (3)
Line Function Params
22 page_exists (pagename)
33 _dochead (main) (args)
40 dochead (invokable) (frame)
Lua modules required (2)
Variable Module Functions used
getArgs Module:Arguments getArgs
ctg Module:Category handler dependency not used

No function descriptions were provided. The Lua code may have further information.


-- This module follows [[User:Ganaram inukshuk/Provisional style guide for Lua]]
local getArgs = require("Module:Arguments").getArgs
local ctg     = require("Module:Category handler")._category_handler

local p = {}

-- Produces a hatnote that is placed on the top of a documentation page (either
-- template or module documentation) and can autodetect and categorize:
-- - FOR MODULES:
--   - whether a module has an accompanying template (overridable)
--   - whether a module is meant as a library for other modules
-- - FOR TEMPLATES:
--   - whether a template has an accompanying module (overridable)
--   - what functions from which modules are invoked

-- Options for specific types of templates and modules include:
-- - (TEMPLATES) whether it's a metatemplate
-- - (MODULES) whether it's a metamodule (used the same way as a metatemplate,
--   but direct use of module code is allowed)

-- Detect whether a page exists, where pagename is "Namespace:Title"
function p.page_exists(pagename)
	local pagename = pagename or "Template:Dochead"
	local title = mw.title.new(pagename)
	
	if title and title.exists then
		return true
	else
		return false
	end
end

function p._dochead(args)
	local pagename = args["pagename"]
	local is_metause = args["is_metause"] or false
	
	
end

function p.dochead(frame)
	local args = getArgs(frame)
	
	
end

return p