Module:SOM.util.References

From SunshinePPS Wiki

Lua error in Module:SOM.util.docs at line 92: attempt to call field 'docs' (a nil value).


require("Module:No globals")

local p = { docs = {} }

-----------------------------------------------------------------------------
p.MISSING_REFERENCES_CATEGORY_TAG = "[[Category:Pages missing references]]"

function p.docs.MISSING_REFERENCES_CATEGORY_TAG()
	return { desc = [=[Wikitext to add a Category tag that will add a page to the
[[:Category:Pages missing references|Pages missing references]] category.]=] }
end


-----------------------------------------------------------------------------
p.MISSING_REFERENCES_VALUE = 
	"<span style=\"color:#f00\">''missing''</span>" ..
	p.MISSING_REFERENCES_CATEGORY_TAG

function p.docs.MISSING_REFERENCES_VALUE()
	return { desc = [=[Wikitext to indicate that a data attribute is missing references or attributions.

This string will be rendered as "''missing''", and will also add a Category tag
that adds the page to the [[:Category:Pages missing references|Pages missing references]] category.]=] }
end


-----------------------------------------------------------------------------
function p.docs.emit_references()
	return {
		desc = [[Creates a <div> displaying citation references.

Equivalent to invoking <references /> in wikitext.
]],
		args = { {"frame", "the current frame"},
			     {"args", "unused"}, },
		returns = "Returns a string containing the formatted-for-display references."
	}
end

function p.emit_references(frame, args)
	local html = mw.html.create("div")
		:css("font-size", "80%")
		:wikitext(frame:extensionTag('references'))
	return html
end




return p