Module:Book: Difference between revisions

From Eli's Software Encyclopedia
mNo edit summary
Tag: Reverted
mNo edit summary
Tag: Reverted
Line 15: Line 15:


local titleObj    = mw.title.getCurrentTitle()
local titleObj    = mw.title.getCurrentTitle()
getData(frame)
local data = getData(frame)


     local data = {
     local props = {
     'Has Title=' .. booktitle,
     'Has Title=' .. data.booktitle,
     'Author=' .. authors,
     'Author=' .. data.authors,
     '+sep=,',
     '+sep=,',
     'Publisher=' .. publisher,
     'Publisher=' .. data.publisher,
     'Release Date=' .. releaseDate,
     'Release Date=' .. data.releaseDate,
     'Genre=' .. genre,
     'Genre=' .. data.genre,
     'ISBN=' .. isbn,
     'ISBN=' .. data.isbn,
     'LCC=' .. lcc,
     'LCC=' .. data.lcc,
     'Book Format=' .. bookformat,
     'Book Format=' .. data.bookformat,
     'Country=' .. country,
     'Country=' .. data.country,
     'Language=' .. language
     'Language=' .. data.language
}
}
mw.smw.set( data )
mw.smw.set( data )

Revision as of 12:09, August 19, 2025

Documentation for this module may be created at Module:Book/doc

local p = {}

local function getData(frame)
  local parent = frame and frame:getParent()
  if not parent then return {} end
  local args = parent.args or {}
  return args
end

function p.semanticStore(infobox)
	
end

function p.semanticStore(frame)

	local titleObj    = mw.title.getCurrentTitle()
	local data = getData(frame)

    local props = {
    	'Has Title=' .. data.booktitle,
    	'Author=' .. data.authors,
    	'+sep=,',
    	'Publisher=' .. data.publisher,
    	'Release Date=' .. data.releaseDate,
    	'Genre=' .. data.genre,
    	'ISBN=' .. data.isbn,
    	'LCC=' .. data.lcc,
    	'Book Format=' .. data.bookformat,
    	'Country=' .. data.country,
    	'Language=' .. data.language
	}
	mw.smw.set( data )

end

return p