Jump to content

Module:Sandbox/Gonnym/Script basic documentation

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Gonnym (talk | contribs) at 11:49, 6 June 2024 (Gonnym moved page Module:Script basic documentation to Module:Sandbox/Gonnym/Script basic documentation). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
require("strict")

--- @module
local p = {}

function p.main(frame)
	local title = mw.title.getCurrentTitle().subpageText
	title = mw.ustring.lower(title)
	local styles = "Template:Script/styles " .. title .. ".css"
	mw.log(styles)
	local styles_page = mw.title.new(styles):getContent()
	local font_names = {}
	for font_names in styles_page:gmatch("font%-family:%s-([^,;]+)") do
	    table.insert(font_names, font_name)
	end
	
	return font_names
end

return p