Différences entre versions de « Module:User »

De Gregorius 3.0
Sauter à la navigation Sauter à la recherche
(Page créée avec « local p = {} function p.infobox(f) local capiunto = require 'capiunto' local linkedwiki = require 'linkedwiki' local endpointUpsud = 'http://opendata1.opendata... »)
 
Ligne 4 : Ligne 4 :
 
local capiunto = require 'capiunto'
 
local capiunto = require 'capiunto'
 
     local linkedwiki = require 'linkedwiki'
 
     local linkedwiki = require 'linkedwiki'
 +
    linkedwiki.setCurrentFrame(mw.getCurrentFrame()) -- added by hand
 
      
 
      
 
local endpointUpsud = 'http://opendata1.opendata.u-psud.fr/sparql'
 
local endpointUpsud = 'http://opendata1.opendata.u-psud.fr/sparql'

Version du 29 octobre 2021 à 09:04

La documentation pour ce module peut être créée à Module:User/doc

local p = {}

function p.infobox(f)
	local capiunto = require 'capiunto'
    local linkedwiki = require 'linkedwiki'
    linkedwiki.setCurrentFrame(mw.getCurrentFrame()) -- added by hand
    
	local endpointUpsud = 'http://opendata1.opendata.u-psud.fr/sparql'
	
   local rdfs = 'http://www.w3.org/2000/01/rdf-schema#'
   local daapProp = 'http://daap.eu/wiki/Property:'
   local geo = 'http://www.w3.org/2003/01/geo/wgs84_pos#'
   local vcard = 'http://www.w3.org/2006/vcard/ns#'
   
   linkedwiki.setEndpoint(endpointUpsud)
   linkedwiki.setSubject(linkedwiki.getCurrentIRI())
   
	return capiunto.create( {
	    -- bodyStyle = 'border: 15px solid red',
		title =  linkedwiki.checkLink(linkedwiki.getCurrentIRI(), rdfs..'label',f.args.Title)  ,
                top = 'User',
		topStyle = 'background:#cfc;font-size:larger',		
		bottom = linkedwiki.checkExternLink('Website',rdfs..'seeAlso',f.args.Website)
	} )
	:addRow('Fullname', linkedwiki.checkValue(vcard..'fn',f.args.Fullname))
	:addRow('Email', linkedwiki.checkValue(vcard..'email',f.args.Email))
	:addWikitext( linkedwiki.getMaintenanceCategory() ..  "[[Category:User]]" )
	
end
 
return p