モジュール:Author

提供: ひつじ小屋別館2代目
2013年3月10日 (日) 08:24時点におけるRical (トーク)による版 (debug for Module:Author/doc)

(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先: 案内検索
documentation view / edit

Module:Author

Lua エラー 958 行目: attempt to call field 'erreur_lister' (a nil value)


-- This module draw a header of Author page in wikisource
-- it is called by templates {{Author... or {{Auteur...
-- http://www.mediawiki.org/wiki/Module:Author

--[[
-- MediaWiki 1.21wmf9 (070f4b4). 14/02/13
-- MediaWiki 1.21wmf9 (afbf386). 15/02/13 test2
-- MediaWiki 1.21wmf9 (afbf386). 15/02/13 test2
-- MediaWiki     1.21wmf10 (edeb4e1) 18/02/13 test2
-- https://gerrit.wikimedia.org/r/#/c/49601/
-- Patch Set 1 - 96615c97b03bbfacb27e749a1d42971429d76852 (gitweb)

3.25 Scribunto

	6 days ago Brad JorschMake our loader work like Lua's built-in loaders 15-6=9/2/13
    git #5584810 - Make our loader work like Lua's built-in loaders
    https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Scribunto.git;a=commit;h=5584810c2d69602b33297821dd7467742722980f
    https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Scribunto.git;a=commit;h=fddf05c0566aca35bc10b0b8fa4abed8668b7134
    
    git #8d02895 - Create wmf/1.21wmf9 branch and update .gitreview
    
    2013-01-31 Brad JorschLua library support functions
    git #4c69b13 - Lua library support functions
    git #0a8a07d - Fix package.loaded and other cleanups
     
--]]

--[[
editing code UTF-16 (MacRoman ?)
Exemple tous paramètres :
{{Auteur |c=:|options=fr test params
|nom=Hugo|prénom=Victor|prénomGall= Arthur
|cle=Hugo Victor|initiale=H
|image=Victor Hugo.jpg |description=écrivain français
|texte=vie |categorie=Auteurs |lien=du |liaison=de l'
|texteNaissance=a |categorieNaissance=Auteurs
|incertitudeNaissance= vers |lienNaissance=du |liaisonNaissance=en
|anneeNaissance= 1802 |siecleNaissance= 19
|texteDeces=a |categorieDeces=Auteurs
|incertitudeDeces= après |lienDeces= du |liaisonDeces=en
|anneeDeces= 1885 |siecleDeces= 19
|droits=non |pseudo=Monsieur Legrand
|genre=Romanciers/Poètes/Auteurs de théatre
|langue=français |pays=France/Italie/Grèce
|metier=Académiciens/Personnalités politiqp.md_dataues
|prix=Prix Nobel de littérature
|VIAF=34452139|NLA=35096649|BNF=cb11888266r|SELIBR=34648|PND=11850133X|LCCN=n/50/23101
|border=0
}}

* Init of unit tests. test_list = table
* Begin of unit tests :
* 1 Site tested : mw.uri.fullUrl = //fr.wikisource.org/wiki/Module:Auteur.
* 2 Environment : Mediawiki 1.21wmf10 (d6c6dba) version UTC 2013-03-01 21:53:59.
* 3 Runtime and spaces : server UTC 2013-03-04 01:09:22, namespace=Modèle module_space=Module, template_space=Modèle viewErrors=true.
* 4 frame.args Error : frame.args.lastname = "error". The OK value was "OK" = frame:getParent().args.lastname.
* 5 sub table write Test OK : sub table write OK. / / / result OKOK  ; exec_ok=true ; value_ok=true ; var_tested=td.C.X ; value_before=xx ; value_after=okvalue ; A=aa ; Y=yy .
* 6 Is Scribunto complete ? Error : Scribunto is not complete. / / /  ; math=table ; os=table ; package=table ; string=table ; table=table ; mw=table ; frame=table ; mw.language=table ; mw.message=nil ; mw.site=table ; mw.title=nil ; mw.uri=table ; mw.ustring=table .
* End of unit tests. Statistic count : Nerr=2 / Ntests=6

local mw = require "Module:mw"

local unitestScribunto = require "Module:Unitest Scribunto"

local rq.argts = require "Module:Multilingual Arguments"

local rq = {
    argts = require("Module:Multilingual Arguments"),
    mw = require("Module:Mw")
}

--]]

local rq = {
	argts = require("Module:Multilingual Arguments"),
	uts = require("Module:Unitest Scribunto"),
--	mw = require("Module:Mw")
}


local args_known_notices = {

		-- arguments for notices's properties

		ARC =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "ARC", old = "ws-ARC"},

		ARCid =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "ARCid", old = "ws-ARCid"},

		ARCitem =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "ARCitem", old = "ws-ARCitem"},

		ARCorg =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "ARCorg", old = "ws-ARCorg"},

		ARCsub =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "ARCsub", old = "ws-ARCsub"},

		BNF =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "BNF", old = "ws-BNF"},

		GKD =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "GKD", old = "ws-GKD"},

		GKD_V1 =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "GKD_V1", old = "ws-GKD-V1"},

		IA =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "IA", old = "ws-IA"},

		ARCHIVE =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "ARCHIVE", old = "ws-ARCHIVE"},

		IBL =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "IBL", old = "ws-IBL"},

		IBLid =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "IBLid", old = "ws-IBLid"},

		IBLbook =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "IBLbook", old = "ws-IBLbook"},

		ISBN =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "ISBN", old = "ws-ISBN"},

		ISFDB =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "ISFDB", old = "ws-ISFDB"},

		ISFDBid =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "ISFDBid", old = "ws-ISFDBid"},

		ISFDBpub =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "ISFDBpub", old = "ws-ISFDBpub"},

		ISFDBtitle =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "ISFDBtitle", old = "ws-ISFDBtitle"},

		LCCN =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "LCCN", old = "ws-LCCN"},

		LT =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "LT", old = "ws-LT"},

		OCLC =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "OCLC", old = "ws-OCLC"},

		OL =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "OL", old = "ws-OL"},

		PND =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "PND", old = "ws-PND"},

		SELIBR =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "SELIBR", old = "ws-SELIBR"},

		SUDOC =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "SUDOC", old = "ws-SUDOC"},

		SWD =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "SWD", old = "ws-SWD"},

		ULAN =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "ULAN", old = "ws-ULAN"},

		VIAF =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "VIAF", old = "ws-VIAF"},

		WORLDCATID =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "WORLDCATID", old = "ws-WORLDCATID"},

		XXX =		{val = "", typ = "not", need = "0", list = 3,
			keyword = "XXX", old = "ws-XXX"},
			
} -- local args_known_notices

local notices_properties = { -- Table of notices's properties, to automate them
	-- REF_0 = reference en un seul numéro comme "cb11888266r"
	-- REF_1/REF_2/REF_3 = reference en trois parties comme "123/456/789 ou "Hugo/Victor/Victor André"
	{base = "ARC",	_id = "ARC",        _wsid = "ws-ARC",		_sauf = "", _space = "", _type = "",
		text = "National Archives and Records Administration",
		wptx = "National%%20Archives%%20and%%20Records%%20Administration",
		_link= "http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_0"},
	{base = "ARC",	_id = "ARCgeo",      _wsid = "ws-ARCgeo",	_sauf = "", _space = "", _type = "Geo",
		text = "National Archives and Records Administration",
		wptx = "National%%20Archives%%20and%%20Records%%20Administration",
		_link= "http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_0"},
	{base = "ARC",	_id = "ARCid",      _wsid = "ws-ARCid",		_sauf = "", _space = "", _type = "Auteur",
		text = "National Archives and Records Administration",
		wptx = "National%%20Archives%%20and%%20Records%%20Administration",
		_link= "http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_0"},
    {base = "ARC",	_id = "ARCitem",    _wsid = "ws-ARCitem",	_sauf = "", _space = "", _type = "Book",
		text = "National Archives and Records Administration",
		wptx = "National%%20Archives%%20and%%20Records%%20Administration",
		_link= "http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_0"},
    {base = "ARC",	_id = "ARCorg",    _wsid = "ws-ARCorg",		_sauf = "", _space = "", _type = "Org",
		text = "National Archives and Records Administration",
		wptx = "National%%20Archives%%20and%%20Records%%20Administration",
		_link= "http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_0"},
    {base = "ARC",	_id = "ARCsub",    _wsid = "ws-ARCsub",		_sauf = "", _space = "", _type = "Auteur",
		text = "National Archives and Records Administration",
		wptx = "National%%20Archives%%20and%%20Records%%20Administration",
		_link= "http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_0"},
    {base = "ARC",	_id = "ARCHIVE",    _wsid = "ws-ARCsub",		_sauf = "", _space = "", _type = "Auteur",
		text = "National Archives and Records Administration",
		wptx = "National%%20Archives%%20and%%20Records%%20Administration",
		_link= "http://www.archive.org/details/REF_0"},
	{base = "BNF",	_id = "BNF",    _wsid = "BNF",		_sauf = "", _space = "", _type = "Auteur",
		text = "Bibliothèque nationale de France",
		wptx = "Biblioth%%C3%%A8que%%20nationale%%20de%%20France",
		_link= "http://catalogue.bnf.fr/ark:/12148/REF_0"},
	{base = "DNB",	_id = "DNB",    _wsid = "DNB",		_sauf = "", _space = "", _type = "Auteur",
		text = "Bibliothèque nationale allemande",
		wptx = "Biblioth%%C3%%A8que%%20nationale%%20allemande",
		_link= "http://d-nb.info/gnd/REF_0"},
	{base = "GKD",	_id = "GKD",    _wsid = "GKD",		_sauf = "", _space = "", _type = "Auteur",
		text = "Bibliothèque nationale allemande",
		wptx = "Biblioth%%C3%%A8que%%20nationale%%20allemande",
		_link= "http://d-nb.info/gnd/REF_0"},
	{base = "GKD",	_id = "GKD-V1",    _wsid = "GKD-V1",	_sauf = "", _space = "", _type = "Auteur",
		text = "Bibliothèque nationale allemande",
		wptx = "Biblioth%%C3%%A8que%%20nationale%%20allemande",
		_link= "http://d-nb.info/gnd/REF_0"},
	{base = "IA",	_id = "ARCHIVE",    _wsid = "IA",	_sauf = "", _space = "", _type = "Auteur",
		text = "Internet Archive",
		wptx = "Internet%%20Archive",
		_link= "http://www.archive.org/REF_0"},
	{base = "IA",	_id = "IA",    _wsid = "IA",		_sauf = "", _space = "", _type = "Auteur",
		text = "Internet Archive",
		wptx = "Internet%%20Archive",
		_link= "http://www.archive.org/REF_0"},
		
	{base = "IBL",	_id = "IBL",    _wsid = "IBL",		_sauf = "", _space = "", _type = "Auteur",
		text = "Internet Archive",
		wptx = "Internet%%20Archive",
		_link= "http://www.iblist.com/bookREF_0.html"},
		
	{base = "IBL",	_id = "IBLbook",    _wsid = "IBLbook",	_sauf = "", _space = "", _type = "Auteur",
		text = "Internet Archive",
		wptx = "Internet%%20Archive",
		_link= "http://www.iblist.com/bookREF_0.html"},
		
	{base = "IBL",	_id = "IBLid",    _wsid = "IBLid",	_sauf = "", _space = "", _type = "Auteur",
		text = "Internet Book List", -- Pas de page fr, en redirige vers Base de données bibliographiques
		wptx = "Internet%%20Archive",
		_link= "http://www.iblist.com/authorREF_0.html"},
			
--[[
	linkList
	pour memoire, pour chaque nomlien : [ [Catégorie:Nota{{{nomlien|{{{1|}}} }}}] ]
	-->|ISBN=http://fr.wikisource.org/wiki/Spécial:Ouvrages_de_référence/{{{code|{{{2|}}} }}}<!--
	-->|ISFDBid=http://www.isfdb.org/cgi-bin/ea.cgi?{{{code|{{{2|}}} }}}<!-- Auteur:
	-->|ISFDBpub=http://www.isfdb.org/cgi-bin/pl.cgi?{{{code|{{{2|}}} }}}<!--
	-->|ISFDBtitle=http://www.isfdb.org/cgi-bin/title.cgi?{{{code|{{{2|}}} }}}<!--
	-->|ISFDB=http://catalogue.bnf.fr/ark:/12148/{{{code|{{{2|}}} }}}<!--
--]]

--[[ nameList of notices's properties
	-->|ARCid|ARCitem|ARCorg|ARCsub<!--
	-->|ARC=National Archives and Records Administration<!--
	-->|BNF=Bibliothèque nationale de France<!--
	-->|GKD|GKD-V1=Gemeinsame Kšrperschaftsdatei<!--
	-->|IA|ARCHIVE=Internet Archive<!--
	-->|IBL|IBLid|IBLbook=Internet Book List<!--
	-->|ISBN=International Standard Book Number<!--
	-->|ISFDBid|ISFDBpub|ISFDBtitle<!--
	-->|ISFDB=Internet Speculative Fiction Database<!--
	-->|LCCN=Numéro de contrôle de la Bibliothèque du Congrès<!--
	-->|LT=Library Thing<!--
	-->|OCLC=Online Computer Library Center<!--
	-->|OL=Open Library<!--
	-->|PND=Personennamendatei<!--
	-->|SELIBR=National Library of Sweden<!--
	-->|SUDOC=Système universitaire de documentation<!--
	-->|SWD=Schlagwortnormdatei<!--
	-->|ULAN=Union List of Artist Names<!--
	-->|VIAF=Fichier d'autorité international virtuel<!--
	-->|WORLDCATID=WorldCat<!--
	-->|XXX=XXX autorité<!--
	-->|#default={{{wp|{{{3|}}} }}} <!--
--]]
	
    {base = "ISNI",	_id = "ISNI",      _wsid = "ws-ISNI",	    _sauf = "", _space = "", _type = "Auteur",
		text = "International Standard Name Identifier",
		wptx = "International%%20Standard%%20Name%%20Identifier",
		_link="http://isni.oclc.nl/DB=1.2/SET=10/TTL=1/CMD?ACT=SRCHA&IKT=8006&SRT=&TRM=REF_0"},
	{base = "OCLC",	_id = "OCLC",       _wsid = "ws-OCLC",		_sauf = "", _space = "", _type = "Auteur",
		text = "Online Computer Library Center",
		wptx = "Online%%20Computer%%20Library%%20Center",
		_link="http://www.worldcat.org/oclc/REF_0"},
	{base = "PND",	_id = "PND",   	    _wsid = "ws-PND",		_sauf = "", _space = "Portail", _type = "Auteur",
		text = "Personennamendatei",
		wptx = "Personennamendatei",
		_link="http://d-nb.info/gnd/REF_0"},
--[[
	linkList
	pour memoire, pour chaque nomlien : [ [Catégorie:Nota{{{nomlien|{{{1|}}} }}}] ]
	-->|ARCgeo=http://arcweb.archives.gov/arc/action/ExecuteRelatedGeographicalSearch?id={{{code|{{{2|}}} }}}&relationship=AD_SUBJECT<!--
	-->|ARC<!--
	-->|ARCid=http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id={{{code|{{{2|}}} }}}<!--
	-->|ARCitem=http://arcweb.archives.gov/arc/action/ExternalIdSearch?id={{{code|{{{2|}}} }}}<!--
	-->|ARCorg=http://arcweb.archives.gov/arc/action/ExecuteRelatedOrganizationSearch?id={{{code|{{{2|}}} }}}&relationship=AD_SUBJECT<!--
	-->|ARCsub=http://arcweb.archives.gov/arc/action/ExecuteRelatedTopicalSubjectsSearch?id={{{code|{{{2|}}} }}}<!--
	-->|ARCHIVE=http://www.archive.org/details/{{{code|{{{2|}}} }}}<!--
	-->|BNF=http://catalogue.bnf.fr/ark:/12148/{{{code|{{{2|}}} }}}<!--
	-->|DNB=http://d-nb.info/gnd/{{{code|{{{2|}}} }}}<!--
	-->|GKD=http://d-nb.info/gnd/{{{code|{{{2|}}} }}}<!--
	-->|GKD-V1=http://d-nb.info/gnd/{{{code|{{{2|}}} }}}<!--
	-->|IA|ARCHIVE=http://catalogue.bnf.fr/ark:/12148/{{{code|{{{2|}}} }}}<!--
	-->|IBL<!--
	-->|IBLbook=http://www.iblist.com/book{{{code|{{{2|}}} }}}.html<!--
	-->|IBLid=http://www.iblist.com/author{{{code|{{{2|}}} }}}.html<!--
	-->|ISBN=http://fr.wikisource.org/wiki/Spécial:Ouvrages_de_référence/{{{code|{{{2|}}} }}}<!--
	-->|ISFDBid=http://www.isfdb.org/cgi-bin/ea.cgi?{{{code|{{{2|}}} }}}<!-- Auteur:
	-->|ISFDBpub=http://www.isfdb.org/cgi-bin/pl.cgi?{{{code|{{{2|}}} }}}<!--
	-->|ISFDBtitle=http://www.isfdb.org/cgi-bin/title.cgi?{{{code|{{{2|}}} }}}<!--
	-->|ISFDB=http://catalogue.bnf.fr/ark:/12148/{{{code|{{{2|}}} }}}<!--
	-->|LCCN=http://id.loc.gov/authorities/names/{{ParmPart|1|{{{code|{{{2|}}} }}} }}{{ParmPart|2|{{{code|{{{2|}}} }}} }}{{padleft:{{ParmPart|3|{{{code|{{{2|}}} }}} }}|6|0}}.html<!--
	-->|LCCNid=http://id.loc.gov/authorities/names/{{ParmPart|1|{{{code|{{{2|}}} }}} }}{{ParmPart|2|{{{code|{{{2|}}} }}} }}{{padleft:{{ParmPart|3|{{{code|{{{2|}}} }}} }}|6|0}}.html<!--
	-->|LCCNbook=http://lccn.loc.gov/{{{code|{{{2|}}} }}}<!--
	-->|LT=http://www.librarything.com/work/{{{code|{{{2|}}} }}}<!--
	-->|NLA=http://nla.gov.au/anbd.aut-an{{{code|{{{2|}}} }}}<!--
	-->|OCLC=http://www.worldcat.org/oclc/{{{code|{{{2|}}} }}}<!--
	-->|OL=http://openlibrary.org/books/{{{code|{{{2|}}} }}}<!--
	-->|PND=http://d-nb.info/gnd/{{{code|{{{2|}}} }}}<!--
	-->|SELIBR=http://libris.kb.se/auth/{{{code|{{{2|}}} }}}<!--
	-->|SUDOC=http://www.idref.fr/{{{code|{{{2|}}} }}}<!--
	-->|SWD=http://d-nb.info/gnd/{{{code|{{{2|}}} }}}<!--
	-->|ULAN=http://www.getty.edu/vow/ULANFullDisplay?find=&role=&nation=&subjectid={{{code|{{{2|}}} }}}<!--
	-->|VIAF=http://viaf.org/viaf/{{{code|{{{2|}}} }}}<!--
	-->|WORLDCAT=http://www.worldcat.org/search?qt=worldcat_org_all&q={{ParmPart|1|{{{code|{{{2|}}} }}} }}+{{ParmPart|2|{{{code|{{{2|}}} }}} }}<!-- http://www.worldcat.org/search?qt=worldcat_org_all&q=Alain+Fournier
	-->|WORLDCATch=http://www.worldcat.org/search?q={{ParmPart|1|{{{code|{{{2|}}} }}} }}-{{ParmPart|2|{{{code|{{{2|}}} }}} }}&qt=owc_search<!-- http://www.worldcat.org/search?q=Alain-Fournier&qt=owc_search
	-->|WORLDCATID=http://www.worldcat.org/identities/{{{code|{{{2|}}} }}}<!--
	-- http://www.worldcat.org/search?q=Alain-Fournier&qt=owc_search
	-- http://www.worldcat.org/search?qt=worldcat_org_all&q=Alain+Fournier
	-->|XXX=http://catalogue.bnf.fr/ark:/12148/{{{code|{{{2|}}} }}}[ [Catégorie:Nota{{{nomlien|{{{1|xxx}}} }}}] ]<!--
	-->|#default=http://fr.wikisource.org/wiki/Modèle:Notice_Autorité<!--
--]]

--[[
	wsdata["ws-ARC"] = args.ARC
	wsdata["ws-ARCgeo"] = args.ARCgeo
	wsdata["ws-ARCid"] = args.ARCid
	wsdata["ws-ARCitem"] = args.ARCitem
	wsdata["ws-ARCorg"] = args.ARCorg
	wsdata["ws-ARCsub"] = args.ARCsub
	wsdata["ws-ARCHIVE"] = args.ARCHIVE
	wsdata["ws-BNF"] = args.BNF
	wsdata["ws-GKD"] = args.GKD
	wsdata["ws-GKD-V1"] = args["GKD-V1"]
	wsdata["ws-IA"] = args.IA
	wsdata["ws-IBL"] = args.IBL
	wsdata["ws-IBLbook"] = args.IBLbook
	wsdata["ws-IBLid"] = args.IBLid
	wsdata["ws-ISBN"] = args.ISBN
	wsdata["ws-ISNI"] = args.ISNI
	wsdata["ws-LCCN"] = args.LCCN
	wsdata["ws-OCLC"] = args.OCLC
	wsdata["ws-NLA"] = args.NLA
	wsdata["ws-PND"] = args.PND
	wsdata["ws-SELIBR"] = args.SELIBR
	wsdata["ws-SWD"] = args.SWD
	wsdata["ws-VIAF"] = args.VIAF
	wsdata["ws-WORLDCAT"] = args.WORLDCAT
	wsdata["ws-WORLDCATch"] = args.WORLDCATch
	wsdata["ws-WORLDCATID"] = args.WORLDCATID
	wsdata["ws-XXX"] = args.XXX
--]]	
	{base = "SELIBR",	_id = "SELIBR",	_wsid = "ws-SELIBR",		_sauf = "", _space = "Auteur", _type = "Auteur",
		text = "Bibliothèque royale (Suède)",
		wptx = "Biblioth%%C3%%A8que_royale_%%28Su%%C3%%A8de%%29",
		_link="http://libris.kb.se/auth/REF_0"},
	{base = "SUDOC",	_id = "SUDOC",		_wsid = "ws-SUDOC",		_sauf = "", _space = "", _type = "Auteur",
		text = "Système universitaire de documentation",
		wptx = "Syst%%C3%%A8me%%20universitaire%%20de%%20documentation",
		_link="http://www.idref.fr/REF_0"},
	{base = "SWD",	_id = "SWD",			_wsid = "ws-SWD",		_sauf = "", _space = "", _type = "Auteur",
		text = "Schlagwortnormdatei",
		wptx = "Schlagwortnormdatei",
		_link="http://d-nb.info/gnd/REF_0"},
	{base = "ULAN",	_id = "ULAN",       _wsid = "ws-ULAN",			_sauf = "", _space = "", _type = "Auteur",
		text = "Union List of Artist Names",
		wptx = "Union%%20List%%20of%%20Artist%%20Names",
		_link="http://www.worldcat.org/oclc/REF_0"},
	{base = "VIAF",	_id = "VIAF",       _wsid = "ws-VIAF",			_sauf = "", _space = "", _type = "Auteur",
		text = "Fichier d'autorité international virtuel",
		wptx = "Fichier%%20d%%27autorit%%C3%%A9%%20international%%20virtuel",
		_link="http://viaf.org/viaf/REF_0"},
	{base = "WORLDCAT",	_id = "WORLDCAT",   _wsid = "ws-WORLDCAT",	_sauf = "", _space = "", _type = "",
		text = "WorldCat",
		wptx = "WorldCat",
		_link="http://www.worldcat.org/search?qt=worldcat_org_all&q=REF_2+REF_1"},
	{base = "WORLDCAT",	_id = "WORLDCATch", _wsid = "ws-WORLDCATch",_sauf = "", _space = "", _type = "",
		text = "WorldCat",
		wptx = "WorldCat",
		_link="http://www.worldcat.org/search?q=REF_2-REF_1&qt=owc_search"},
	{base = "WORLDCAT",	_id = "WORLDCATID", _wsid = "ws-WORLDCATID",_sauf = "", _space = "", _type = "Auteur",
		text = "WorldCat",
		wptx = "WorldCat",
		_link="http://www.worldcat.org/identities/REF_0"},
	-- Pour tests futurs sans perturber les notices réelles
	{base = "XXX",	_id = "XXXid",        _wsid = "ws-XXX",			_sauf = "", _space = "", _type = "Auteur",
		text = "XXX autorité",
		wptx = "XXX%%20autorit%%C3%%A9",
		_link="http://catalogue.bnf.fr/ark:/12148/REF_0"}
} -- notices_properties table								ws-OCLC ws-PND ws-ISNI SELIBR SWD VIAF WORLDCATch

--[[
boite deroulante pour module interactif ?
<a id="NavToggle3" class="NavToggle" href="javascript:toggleNavigationBar(3);">[Dérouler]</a>
--]]

-- {{Nota | BNF | {{{BNF | cb11888266r }}} | BNF | http://catalogue.bnf.fr/ark:/12148/{{{BNF|cb11888266r}}} | espace=Auteur }}
local HTMLnotice = function(control, data, ref, noticeN)
	-- Generer le wikitexte d'une notice selon ref, "id", "sauf", et l'espace de nom
	-- exemple : notice(control, data, "cb11888266r", noticeN)
	if nil == noticeN then return "" end
	local id = noticeN._id
	if nil == id then return "" end
	if nil == ref then ref = "" end
	local wptx = toUTF8(noticeN.text)
	-- wikitext structure
	-- [[File:Farm-Fresh draw calligraphic.png|22px|link=http://lccn.loc.gov/cb11888266r|BNF : cb11888266r]]
	local wt = '<span style="margin-left:10px;" > &nbsp; * &nbsp; [link_1 title_1] : [[File:Farm-Fresh draw calligraphic.png|22px|link=link_2|a_l_t]]</span>'
	-- title1="ARCid"
	wt = string.gsub(wt, "title_1", '' .. id)
	-- link1="http://fr.wikipedia.org/wiki/Biblioth%C3%A8que_nationale_de_France"
	wt = string.gsub(wt, "link_1", 'http://fr.wikipedia.org/wiki/' .. noticeN.wptx)
	-- title2="BNF : cb11888266r"
	wt = string.gsub(wt, "title_2", id .. " : " .. ref)
	-- link2="http://catalogue.bnf.fr/ark:/12148/cb11888266r"
	wt = string.gsub(wt, "link_2", noticeN._link)
	-- alt="BNF  : cb11888266r"
	wt = string.gsub(wt, "a_l_t", id .. " : " .. ref)
	-- Remplacer ref dans link
	wt = string.gsub(wt, "REF_0", ref)
	-- Remplacer des parties de ref dans link
	local N = 1
	-- ref = "ref1/ref2/ref3" comme "123/456/789" ou "Dubois/Angèle/Marie"
	for refN in string.gmatch(ref, "[^/]") do
		-- lire les portions de textes séparées par un /, ainsi [^/] selectionne tous les caracteres sauf /,
		if refN ~= ref then -- si on trouve des portions de ref
			wt = string.gsub(wt, "REF_" .. tostring(N), refN) -- on les remplace dans wt
		end
		N = N + 1
	end
	return wt
end -- HTMLnotice = function(control, data, ref, noticeN)

--	{base = "ARC",      _id = "ARCid",      _wsid = "ws-ARCid",		_sauf = "", _space = "", _type = "Auteur",
--		text = "National Archives and Records Administration",
--		wptx = "National Archives and Records Administration",
--		_link="http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_0"},

local noticeSelect = function(control, data) -- , id, sauf)
	-- noticeList(control, data, "ARCorg", "", "", "cb11888266r", "http://catalogue.bnf.fr/ark:/12148/REF_0")
	-- notice(control, data, id, sauf, ref, space, "ARCorg", "", "http://catalogue.bnf.fr/ark:/12148/REF_0")
	-- notice(control, data, id, sauf, ref, space, "ARC", "ARCid", "http://catalogue.bnf.fr/ark:/12148/REF_0")
	-- local notice = function(control, data, id, sauf, ref, space, _id, _sauf, _space, _link)
	local t = "" -- "<br/>* noticeSelect:" .. tostring(id) .. " : "
	for noticeN in table_iterator(notices_properties) do
		-- pour toutes les notices connues de ce module
		-- collecter les parametres de la notice
		local id = noticeN._id -- id de la notice comme "ARC"
		local ws_id = noticeN._wsid -- ws de la notice comme "ws-ARC"
		local ref_id = rq.argts.argv(id) -- ref de la notice comme "cb11888266r"
		local space_id = noticeN._space -- espace de nom de la notice comme "Portail" ou "Auteur"
		if (type(space_id) ~= "string") then space_id = "" end -- si non defini space_id = ""
		local _type = noticeN._type -- type de la notice "Auteur" ou "Book" autre
		-- collecter les parametres d'une autre notice prioritaire
		local id_sauf = noticeN._sauf -- comme "ARCid"
		local ref_sauf = rq.argts.argv("ws-" .. id_sauf) -- comme "35096649" ref d'une autre notice prioritaire
		-- collecter les parametres de sélection
		local space = "_NAMESPACE_" -- espace de nom actuel comme "Portail" ou "Auteur"
		-- t = t .. ", " .. tostring(id) .. "=" .. tostring(idat) .. ":" .. space_id
		-- selectionner les notices à générer
		if (nil ~= ref_id) then -- exclure la notice si elle n'est pas demandée
			-- t = t .. HTMLnotice(control, data, ref_id, noticeN)
			if (nil == ref_sauf) then -- exclure la notice si une autre est prioritaire et définie
				if ("Auteur" == _type) then -- inclure les notices de type Auteur
					if (space_id ~= "") then -- si la notice est liée à un space de nom
						if (space_id == space) then -- inclure la notice seulement dans son espace de nom
							t = t .. HTMLnotice(control, data, ref_id, noticeN)
						end
					else -- inclure les notices non liées à un space de nom
						t = t .. HTMLnotice(control, data, ref_id, noticeN)
					end
				end
			end
		end
		-- Générer l'affichage de la notice
		-- t = t .. ", " .. tostring(_id) .. ":" .. tostring(wsid) .. "=" .. tostring(idat)
	end
	return '<span> &nbsp; - &nbsp; ' .. Trad.txt('author_Notices') .. ' : ' .. t .. '</span>'
end -- noticeSelect = function(control, data)
--	{base = "ARC",      _id = "ARCid",      _wsid = "ws-ARCid",			_sauf = "", _space = "",
--		text = "National Archives and Records Administration",
--		_link="http://arcweb.archives.gov/arc/action/ExternalPersonIdSearch?id=REF_0"},

local scanNames = function(wt, data)
	-- wt = scanNames("http://gallic ... &q=-ws-name-+-ws-firstname-", md_data) -- replace names for scans
	-- anti errors
--	local name = tostring(data["ws-name"])
	local name = rq.argts.argv("lastname")
	if nil == name then name = "" end
	local firstname = tostring(rq.argts.argv("firstname"))
	if nil == firstname then firstname = "" end
	local firstgall = firstname
	if nil ~= rq.argts.argv("Galliname") then
		firstgall = tostring(rq.argts.argv("Galliname"))
	end
	-- replace names for scans
	wt = tostring(wt)
	wt = tostring(string.gsub(wt, "ws_firstname", firstname) )
	wt = tostring(string.gsub(wt, "ws_name", name) )
	wt = tostring(string.gsub(wt, "ws_firstgall", firstgall) )
	return wt
end

local HTMLscans = function(args, data)
	-- wt = scanNames("http://gallic ... &q=-ws-name-+-ws-firstname-", md_data) -- replace names for scans
	-- anti errors
	-- Generate scans to display
	local SCAN__gallica = "<span> &nbsp; [http://gallica.bnf.fr/Search?ArianeWireIndex=index&p=1&lang=FR&q=ws_name+ws_firstname Gallica] </span>"
	SCAN__gallica = tostring(scanNames(SCAN__gallica, data) )
	local SCAN__europeana = "<span> &nbsp; [http://www.europeana.eu/portal/search.html?query=who:ws_name,%20ws_firstname&qf=LANGUAGE:fr&qf=LANGUAGE:mul&qf=TYPE:TEXT Europeana] </span>"
	SCAN__europeana = tostring(scanNames(SCAN__europeana, data) )
	local SCAN__google = "<span> &nbsp; [https://www.google.fr/search?q=inauthor%3A%22ws_firstname+ws_name%22&ie=utf-8&oe=utf-8&aq=t Google] </span>"
	SCAN__google = tostring(scanNames(SCAN__google, data) )
	local scan_notices = noticeSelect(args, data)
	local xxx = args_trad['author_Scans']
	local yyy = Trad.txt('author_Scans')
	local scans = '<div id="Author" class="vcard" style=" background-color:#F1F1DE; border:0px solid #CCCCCC; "><span>' .. Trad.txt('author_Scans') .. ' : &nbsp; ' .. SCAN__gallica .. SCAN__europeana .. SCAN__google .. scan_notices .. ' </span></div>'
	return scans
end
	-- Trad['fr']author_Scans				= 'Scans fr : ', author_Scans

local droits = function(now, args, data)
	local ri = rq.argts.argv("rights")
	local deathdate = tonumber(rq.argts.argv("deathyear"))
	local nowyear = tonumber(now.year)
	if "mpf" == ri then
		if nil == deathdate then
			return ""
		elseif nowyear < deathdate + 96 then
			return rq.argts.argv("fr-rights-warning-template")
		else
			return ""
		end
	elseif "non" ~= ri then
		local birthdate = tonumber(rq.argts.argv("birthyear"))
		if nil == deathdate then
			return ""
		elseif nowyear < deathdate + 71 then
			return rq.argts.argv("rights-warning-template")
		elseif nil == birthdate then
			return ""
		elseif 1903 > birthdate then
			return rq.argts.argv("rights-warning-template")
		else
			return ""
		end
	else
		return ""
	end
end
 
local catGen = function(catspace, catName, catText) -- generate category
	-- catGen("Category", "Naissance en 1948", "texte affiché") -> [[:Category:Naissance 1948|Naissance 1948]] 
	if nil == catspace then return "" end
	if nil == catName then return "" end
	if (type(catText) == 'string') and (catText ~= '')
		then catText = "|" .. catText
		else catText = '' end
	return "[[" .. catView .. catspace .. ":" .. catName .. catText .. "]]"
end

local catGroup = function(catspace, groupCat, groupList) -- generate some catagories
	-- catGroup(control, "Pays %1", "France/Italie") -> [[Category:Pays France]] [[Category:Pays Italie]] 
	if nil == catspace then return "" end
	if nil == groupCat then return "" end
	if nil == groupList then return "" end
	local cats = string.gsub(groupList, "[^/]+", "[[" .. catView .. catspace .. ":" .. groupCat .. "]] ")
	cats = string.gsub(cats, "/", "")
	return cats
end

local categories = function(control, data)
	--	category_space = frame:preprocess("{{ns:Category}}") -- Category namespace from system, par init
	local catspace = category_space
	local cats = {}
	local initiale = rq.argts.argv("initiale")
	local sans = tostring(rq.argts.argv("authors-category-no-initials") )
	catView = rq.argts.argv("c")
	rq.argts.trck(" categories() initiale=" .. initiale .. " sans=" .. sans .. " catView=" .. catView)
--	if catView == "x:" then catView = ":" end
	if catView ~= ":" then catView = "" end
	if type(initiale) == "string" then
	--	table.insert(cats, catGen(catspace, rq.argts.argv("authors-category-prefix") .. initiale ) )
		table.insert(cats, catGen(catspace, author_space .. initiale ) )
		rq.argts.trck( rq.argts.argv("authors-category-prefix") .. initiale )
	elseif (sans ~= "string") and (sans ~= "") then
		table.insert(cats, catGen(catspace, sans ) )
	end
	rq.argts.trck(" interwiki-category-linked-prefix ")
	local wikipedia = rq.argts.argv("wikipedia")
	local wikiquote = rq.argts.argv("wikiquote")
	local commons = rq.argts.argv("commons")
	local commonscat = rq.argts.argv("commons-category")
	if nil ~= wikipedia then table.insert(cats, catGen(catspace, "Wikipedia") ) end
	if nil ~= wikiquote then table.insert(cats, catGen(catspace, "Wikiquote") ) end
	if nil ~= commons then table.insert(cats, catGen(catspace, "Wikimedia Commons") ) end
	if nil ~= commonscat then table.insert(cats, catGen(catspace, "Wikimedia Commons category") ) end
	rq.argts.trck(" birthyear=" .. rq.argts.argv("birthyear") .. " occupation=" .. rq.argts.argv("occupation") .. " Wikipedia=" .. rq.argts.argv("Wikipedia"))
	rq.argts.trck( "Naissance en " .. rq.argts.argv("birthyear") )
--	if rq.argts.option("fr") then
	table.insert(cats, catGroup(catspace, "Naissance en %1", rq.argts.argv("birthyear") ) )
	table.insert(cats, catGroup(catspace, "Mort en %1", rq.argts.argv("deathyear") ) )
--	end
	-- catGroup(control, "Pays %1", "France/Italie/Grèce")
	-- |genre=Romanciers/Poètes/Auteurs de théatre
	table.insert(cats, catGroup(catspace, "%1", rq.argts.argv("genre") ) )
	-- |langue=français/japonais
	table.insert(cats, catGroup(catspace, "Langue %1", rq.argts.argv("language") ) )
	-- |metier=Académiciens/Personnalités politiques
	table.insert(cats, catGroup(catspace, "%1", rq.argts.argv("occupation") ) )
	-- |pays=France/Italie/Grèce
	table.insert(cats, catGroup(catspace, "Pays %1", rq.argts.argv("country") ) )
	-- |prix=Nobel de littérature/Pulitzer/Renaudot
	table.insert(cats, catGroup(catspace, "Prix %1", rq.argts.argv("prize") ) )
--	table.insert(cats, catGen(catspace, rq.argts.argv("authors-category") ) )
--	table.insert(cats, catGen(catspace, "Birth in %1", rq.argts.argv("birthyear") ) )
--	table.insert(cats, catGen(catspace, "Death in %1", rq.argts.argv("deathyear") ) )
	return table.concat(cats)
end -- categories = function(control, data)

local annotations = {}
annotations["lastname"] = "fn"
annotations["firstname"] = "n"
annotations["description"] = "label"
annotations["birthyear"] = "bday"
annotations["deathyear"] = "dday"
 
local microformat = function(data)
	if data ~= " cette instruction desactive microformat pour debug. " then return "" end
	local text = {}
	local style = "display:none; speak:none;"
	for n,v in pairs(data) do
		local class = annotations[n]
		local datum = mw.text.tag({name="span", contents=v, params={id=n,class=class}})
		table.insert(text, datum)
	end
	return mw.text.tag({name="div", contents=table.concat(text), params={id="ws-data", class="vcard ws-noexport", style=style}})
end
 
local defaultsort = function(control, data)
	local key = tostring(rq.argts.argv("sortkey"))
	local name = tostring(rq.argts.argv("lastname"))
	local given = tostring(rq.argts.argv("givenname"))
	local family = tostring(rq.argts.argv("lastname"))
	local name = key or name or ((given or "_") .. "," .. (family or ""))
	-- local name = data["ws-key"] or data["ws-name"] or ((data["given-name"] or "_") .. "," .. (data["family-name"] or ""))
	return mw.getCurrentFrame():preprocess("{{DEFAULTSORT:" .. name .. "}}")
	-- return "{{DEFAULTSORT:" .. name .. "}}"
end

-- Too basic english version, do not use
local headbox = function(control, data)
    local name = rq.argts.argv("sortkey") or rq.argts.argv("lastname") or ((rq.argts.argv("givenname") or "_") .. "," .. (rq.argts.argv("lastname") or ""))
	local wikipedia = rq.argts.argv("wikipedia")
	local wikiquote = rq.argts.argv("wikiquote")
	local commons = rq.argts.argv("commons")
	local commonscat = rq.argts.argv("commons-category")
    local interwikis = {}
	if nil ~= wikipedia then table.insert(interwikis, "* [[:wikipedia:" .. wikipedia .. "|" .. "Wikipedia]]\n") end
	if nil ~= wikiquote then table.insert(interwikis, "* [[:wikiquote:" .. wikiquote .. "|" .. "Wikiquote]]\n") end
	if nil ~= commons then table.insert(interwikis, "* [[:commons:" .. commons .. "|" .. "Wikimedia Commons]]\n") end
	if nil ~= commonscat then table.insert(interwikis, "* [[:commons:Category:" .. commonscat .. "|" .. "Wikimedia Commons category]]\n") end
	local links = "\n" .. table.concat(interwikis)
	local desc = "'''" .. name .. "'''\n"
	if rq.argts.argv("description") then
		desc = desc .. "\n" .. rq.argts.argv("description")
	end
	local image
	if rq.argts.argv("image") then
		local caption = rq.argts.argv("image-caption") or ""
		image = "[[File:" .. rq.argts.argv("image") .. "|125px|" .. caption .. "]]"
	else
		image = ""
	end
	-- FIXME: The styles, column widths, and CSS classes need adjusting.
	return "{| class=\"wikitable\" width=\"100%\"\n|-" .. name .. "\n|-\n|" .. links .. "\n|" .. desc .. "\n|" .. image .. "\n|}\n"
end

-- French version
local headbox_fr = function(args, data)
    -- Generate the main box, in HTML
	local title = rq.argts.argv("title") -- or rq.argts.argv("lastname") or rq.argts.argv("sortkey") or rq.argts.argv("givenname")
	if type(title) ~= "string" then title = "-" end
	local desc = ""
	if rq.argts.argv("description") then
		desc = desc .. "\n" .. rq.argts.argv("description")
	end
	if type(desc) ~= "string" then desc = "" end
	local image
	if rq.argts.argv("image") then
		local caption = rq.argts.argv("image-caption") or ""
		-- image = "[[File:" .. data["ws-image"] .. "|125px|" .. caption .. "]]"
		image = "[[File:" .. rq.argts.argv("image") .. "|frameless|170x170px||class=photo]]"
	else
		image = ""
	end
	if type(image) ~= "string" then image = "" end
	local initiale = rq.argts.argv("initiale")
	if type(initiale) ~= "string" then initiale = "" end
	-- <br/><span style="color:#aaaa66; line-height:120%; ">\<\<</span>&nbsp;[[:Catégorie:Auteurs-{{{initiale|H}}}|Auteurs&nbsp;{{{initiale|H}}}]]<br /><br />
	--
	-- Generate interwikis links
	local interwikis = {}
	if nil ~= initiale then table.insert(interwikis, '<br/><span style="color:#aaaa66; line-height:120%; ">◀ </span>&nbsp;[[' .. catView .. category_space .. ':' .. author_space .. '-' .. initiale .. '|' .. author_space .. '-' .. initiale .. ']]<br/><br/>') end
	-- Failed to encode the character ◀=(U+25C0) '<<' (U+25C4) at column 73 in line 60
	-- string.gfind(ustring, "([%z\1-\127\194-\244][\128-\191]*)")
	--	if nil ~= data.wikisource then table.insert(interwikis, '<span style="color:#232388; font-size:140%; line-height:120%; ">⦁&nbsp;&nbsp;</span>[[wikisource:' .. control["namespace-author"] .. ':' .. data.wikisource .. '|Fac-similés]]<br/>') end
	if nil ~= rq.argts.argv("wikisource") then table.insert(interwikis, '<span style="color:#232388; font-size:140%; line-height:120%; ">⦁&nbsp;&nbsp;</span>[[wikisource:' .. author_space .. ':' .. rq.argts.argv("wikisource") .. '|Fac-similés]]<br/>') end
	if nil == rq.argts.argv("wikipedia") then rq.argts["wikipedia"]["val"] = title end
	
	if rq.argts.argv("wikipedia") ~= "" then table.insert(interwikis, '<span style="color:#232388; font-size:140%; line-height:120%; ">⦁&nbsp;&nbsp;</span>[[wp:' .. rq.argts.argv("wikipedia") .. '|Biographie]]<br/>') end
--	if rq.argts.argv("wikipedia") ~= "" then table.insert(interwikis, '<span style="color:#232388; font-size:140%; line-height:120%; ">⦁&nbsp;&nbsp;</span>' .. catGen(arg_lang .. ":wikipedia:" .. category_space, rq.argts.argv("wikipedia"), "BiographieXYZ") .. '<br/>') end
	
--	catGen(arg_lang .. ":wikipedia:" .. category_space, rq.argts.argv("wikipedia"), "Biographie")
--	catGen("Category", "Naissance en 1948", "texte affiché")
	
	if nil == rq.argts.argv("wikiquote") then rq.argts["wikiquote"]["val"] = title end
	if nil ~= rq.argts.argv("wikiquote") then table.insert(interwikis, '<span style="color:#232388; font-size:140%; line-height:120%; ">⦁&nbsp;&nbsp;</span>[[wikiquote:' .. rq.argts.argv("wikiquote") .. '|Citations]]<br/>') end
	if nil == rq.argts.argv("commons") then rq.argts["commons"]["val"] = title end
	if nil ~= rq.argts.argv("commons") then table.insert(interwikis, '<span style="color:#232388; font-size:140%; line-height:120%; ">⦁&nbsp;&nbsp;</span>[[commons:' .. rq.argts.argv("commons") .. '|Médias]]<br/>') end
	-- ◄ Auteurs H •  Fac-similés WS •  Biographie WP •  Citations WQ •  Médias WM
	-- if nil ~= data.wikipedia then table.insert(interwikis, "* [[:w:" .. data.wikipedia .. "|" .. "Wikipedia]]\n") end
	-- if nil ~= data.wikiquote then table.insert(interwikis, "* [[:q:" .. data.wikiquote .. "|" .. "Wikiquote]]\n") end
	-- if nil ~= data.commons then table.insert(interwikis, "* [[:commons:" .. data.commons .. "|" .. "Wikimedia  Commons]]\n") end
	-- if nil ~= data.commonscat then table.insert(interwikis, "* [[:commons:Category:" .. data.commonscat .. "|" .. "Wikimedia Commons category]]\n") end
	local links = "\n" .. table.concat(interwikis)
	--
	-- FIXME: The styles, column widths, and CSS classes need adjusting.
	-- FIXME: The french display is in HTML direct to better adapt the size and the look to plural environments.
	--
	-- Generate scans to display
	local scans = HTMLscans(args, data)
	--
	-- Generate wikitext to display
	local wt = '<div id="Author" class="vcard" style="margin-right:5px; box-shadow:0.2em 0.3em 0.2em #B7B7B7; background-color:#F1F1DE; padding:0.3em; width=99.9%; overflow-x:hidden; ">'
	  .. '<table cellspacing="0" cellpadding="0" style="background-color: transparent; border:{{{border|1}}}px solid #CCCCCC; padding:0em;">'
		.. '<tr>'
		  .. '<td valign="middle" rowspan="2" style="padding: 0em 0.6em; background-color: #F1F1DE; text-align:left; font-size:90%; line-height:80%; ">'
			.. '<div style="text-align:left; font-size:120%; padding-top:0.5em; text-indent:1em">'
			  .. links
			.. '</div>'
		  .. '</td>'
		  .. '<td valign="top" align="center" style=" min-width:150px; border-left:{{{border|1}}}px solid #CCCCCC; padding:0.5em; ">'
			.. '<span class="fn" id="AuthorName" style="line-height:90%; font-size:160%; font-weight:bold; padding-top:0.1em; border-bottom: none; ">'
			  .. title
			.. '</span>'
		  .. '</td>'
		  .. '<td valign="middle" align="center" rowspan="2" style=" border-left:{{{border|1}}}px solid #CCCCCC; ">'
			.. '<div id="AuthorImage" style=" padding:4px; ">'
			  .. image
			.. '</div>'
		  .. '</td>'
		.. '</tr>'
		.. '<tr>'
		  .. '<td valign="top" align="center" style="width:100%; border-left:{{{border|1}}}px solid #CCCCCC; padding:1em; ">'
			.. '<span class="label" style=" font-size:110%; line-height:80%; text-align:center; " >'
			  .. desc
			.. '</span>'
		  .. '</td>'
		.. '</tr>'
		.. '<tr>'
		  .. '<td valign="top" align="center" colspan="3" style="width:100%; border-top:{{{border|1}}}px solid #CCCCCC; padding:1em; ">'
			.. '<span class="label" style=" font-size:110%; line-height:80%; text-align:center; " >'
			  .. scans
			.. '</span>'
		  .. '</td>'
		.. '</tr>'
	  .. '</table>'
	.. '</div>'
	return wt
	--   "{| class=\"wikitable\" width=\"100%\"\n|-" .. name .. "\n|-\n|" .. links .. "\n|" .. desc .. "\n|" .. image .. "\n|}\n"
end -- headbox_fr = function(args, data)
 
-- Générer la liste des notices.
local notices_liste = function(notices_properties, args)
	-- notices_liste(notices_properties, args)
	if type(notices_properties) ~= "table" then return "" end
	if type(args) ~= "table" then return "" end
	local t = "<br/>Paramètres de notices d'autorités connues du module : "
	for noticeN in table_iterator(notices_properties) do
		-- pour toutes les notices connues de ce module
		-- collecter les parametres de la notice
		local id = noticeN._id -- id de la notice comme "ARC"
		local wsid = noticeN._wsid -- ws-id de la notice comme "ws-ARC"
		t = t .. id .. "-"
		if rq.argts[wsid] == nil then
		--	erreur_add("err_internal_notice_wsid", tostring(wsid))
		else
			local _type = noticeN._type -- type de la notice "Auteur" ou "Book" ou autre
			t = t .. ", " .. tostring(wsid) .. "=" .. tostring(id) .. ":" .. _type
			if _type == "Auteur" then
				rq.argts[wsid]["val"] = args[id] -- lire les paramètres de notices de type Auteur
				t = t .. "+"
			end
		end
	end
	t = t .. "Fin des notices."
	rq.argts.trck( t )
	return t
end -- local notices_liste = function(notices_properties, args)

--]]

-- Interface http://scribunto.wmflabs.org/
local p = {}

-- Interface pour générer une entête de page d'auteur.
function p.auteur(frame)
	trck_on = rq.argts.option("track")
--	local args = frame.args
--	28/02/2013 This repair Lua bug : args = frame.args is a table but without arguments
	local args = frame:getParent().args -- local pframe
--	rq.argts.args_known_default
--	local args_known_notices
	table.insert(rq.argts.args_known_default, args_known_notices)
	for k, parm in pairs(args_known_notices) do -- Pour tous les parametres connus
		table.insert(rq.argts.args_known_default, parm)
	end
	rq.argts.multi_args(frame) -- _known, _source, _lang)
	local now = { year = args.year, month = args.month, day = args.day } -- UTC ?
--	local prm = rq.argts.new() -- create a new object from the class rq.argts, to update later
	local prm = rq.argts -- arguments connus, known arguments
--	current_space = " ns=" .. mw.site.namespaces.name -- {{NAMESPACE}}
--	current_space = " ns0=" .. frame:preprocess("{{ns:0}}") -- present namespace from system
--	This repair a Lua bug : {{NAMESPACE}} give nothing in fr.wikisource.org
	current_space = frame:preprocess("{{NAMESPACE}}") -- present namespace from system
--	This repair a Lua bug : mw.site.namespaces.name is unknown
	module_space = frame:preprocess("{{ns:Module}}") -- Module namespace from system
	template_space = frame:preprocess("{{ns:Template}}") -- Module namespace from system
	author_space = frame:preprocess("{{ns:Author}}") -- Author namespace from system
	category_space = frame:preprocess("{{ns:Category}}") -- Category namespace from system
	rq.argts.init_args(prm.args_known_default, args)
--	rq.argts.init_args(nil, args, "fr")
	-- local Argtest = { options = " debug fr docavant ", "Rimbaud", "Arthur", "1234", droits = "70", pays = "France" }
	if ArgXXXtest ~= nil then
		local t = rq.argts.args_import_all(Argtest) -- rq.argts.args_import_all(args_src, args_kwn)
		t = t..rq.argts.generDoc("") -- Documentation des arguments dés leur lecture
		return t
	end
--[[
	-- Interact parameters
	-- |nom=Hugo|prénom=Victor|prénomGall= Arthur
	-- The syntax var.Name is just syntactic sugar for var["Name"]
	local lastname = args.nom
	local last_initial = args.initiale
	if "!NO_INITIALS" == last_initial then last_initial = nil end
	local firstname = args["prénom"] or last_initial
	if nil ~= lastname then
		if firstname ~= nil then
			title = firstname .. " " .. lastname
		else
			title = lastname
		end
	end
	wsdata["lastname"] = lastname
	wsdata["ws-firstname"] = firstname
	wsdata["ws-initial"] = last_initial
	wsdata["ws-title"] = title
	wsdata["family-name"] = lastname
	wsdata["given-name"] = firstname
	
	local wsdata = {}
	
	local param_type = "<br/>Paramètres de notices d'autorités connues du module : "
	for noticeN in table_iterator(notices_properties) do
		-- pour toutes les notices connues de ce module
		-- collecter les parametres de la notice, voir docnotice
		local id = noticeN._id -- id de la notice comme "ARC"
		local wsid = noticeN._wsid -- ws-id de la notice comme "ws-ARC"
		if rq.argts[wsid] == nil then
		--	erreur_add("err_internal_notice_wsid", tostring(wsid))
		else
			local _type = noticeN._type -- type de la notice "Auteur" ou "Book" ou autre
			param_type = param_type .. ", " .. tostring(wsid) .. "=" .. tostring(id) .. ":" .. _type
			if _type == "Auteur" then
				rq.argts[wsid]["val"] = args[id] -- lire les paramètres de notices de type Auteur
				param_type = param_type .. "+"
			end
		end
	end
--]]

	rq.argts.args_import_all(args) -- args : import all arguments from template, or other source
	local_options = rq.argts.options_change(local_options, rq.argts.args_known_default["options"]["val"], "init")
	doc_args_import_all = rq.argts.generDoc("") -- Documentation des arguments dés leur lecture
	rq.argts.trck('<br/>* ')
	local argval =  rq.argts.argv("birthdate") -- read arg value from local data
	rq.argts.trck('<br/>* ')
	local argval =  rq.argts.argv("deathdate") -- read arg value from local data
--	local_options = options_change(local_options, rq.argts.argv("options", tr), "init")
	--
	-- Interact parameters
	local lastname = rq.argts.argv("lastname")
	local firstname = rq.argts.argv("firstname")
	local Galliname = rq.argts.argv("Galliname")
	local pseudonym = rq.argts.argv("pseudonym")
	local sortkey = rq.argts.argv("sortkey")
	local familyname = rq.argts.argv("familyname")
	local title = rq.argts.argv("title")
	local initiale = rq.argts.argv("initiale")
	lastname = lastname or pseudonym or sortkey or familyname or initiale
	if title == "" then
		if lastname ~= "" then
			if firstname == "" then
				title = lastname
			else
				title = firstname .. " " .. lastname
			end
	--		elseif Galliname ~= "" then
	--			title = Galliname .. " " .. lastname
		end
	end
	-- if there is no firstname, try to extract it from lastname
	-- ...
	-- link to other wikis
	local wikipedia = rq.argts.argv("wikipedia")
	local wikiquote = rq.argts.argv("wikiquote")
	local commons = rq.argts.argv("commons")
	if wikipedia == "" then wikipedia = title end
	if wikiquote == "" then wikiquote = title end
	if commons == "" then commons = title end
	-- title = firstname .. " " .. lastname
	rq.argts.arg_memorize("lastname", lastname)
	rq.argts.arg_memorize("firstname", firstname)
	rq.argts.arg_memorize("title", title)
	rq.argts.arg_memorize("wikipedia", wikipedia)
	rq.argts.arg_memorize("wikiquote", wikiquote)
	rq.argts.arg_memorize("commons", commons)
	--
	-- Generer des tests et documentations optionnels avant le wikitexte normal
    local unitest = ""
    if rq.argts.option("unitest") then
    	rq.uts.init(frame) -- rq.uts.init( frame, test_list, test_data )
    	rq.uts.run_all_tests( frame )
    	unitest = rq.uts.test_result
    end
	local docavant = ""
	if rq.argts.option("docavant") then
		docavant = doc_args_import_all
	end
	local errs = ""
	if rq.argts.option("erreurs") then errs = rq.argts.erreur_lister() end
	-- docavant = rq.argts.generDoc("")
	--
	-- Generer le wikitext et HTML normal, categories et autres (sauf options contraires)
	local box = headbox_fr(args, wsdata)
	if rq.argts.option("nobox") then box = "" end
	local cat = categories(control, wsdata)
    if rq.argts.option("nocat") then cat = "" end
	local dat = microformat(wsdata)
	local drs = droits(now, control, wsdata)
	local ds = defaultsort(control, wsdata)
    --
	-- Generer des tests et documentations optionnels après le wikitexte normal
	local doc_notice = ""
    if rq.argts.option("docnotice") then doc_notice = notices_liste(notices_properties, args) end
	local docapres = ""
	if rq.argts.option("docapres") then
		docapres = doc_args_import_all
	end
	local track = ""
	if trck_on then track = trc end
--	if rq.argts.option("track") then track = trc end
--		errs = erreur_lister("<br/>Erreurs pendant l'affichage initial de l'entète d'auteur :")
--		errs = '<span style="color:red;" >' .. errs .. '</span>'
--	end
	return unitest .. docavant .. errs .. box .. cat .. dat .. drs .. ds .. doc_notice .. docapres .. track .. '<br/>'
end -- p.auteur(frame)

-- Alias pour Interface pour générer une entête de page d'auteur.
function p.fr(frame)
	return p.auteur(frame)
end -- p.fr(frame)

-- Interface pour générer une notice d'autorité indépendante sur une personne, un livre ou autre.
function p.notice(frame)
--	local pframe = frame:getParent()
--	local args = pframe.args
	local args = frame.args
	local now = { year = args.year, month = args.month, day = args.day }
	-- local prm = rq.argts.new() -- create a new object from the class rq.argts
	local prm = rq.argts -- arguments connus, known arguments
	category_space = frame:preprocess("{{ns:Category}}") -- Category namespace from system
	author_space = frame:preprocess("{{ns:Author}}") -- Category namespace from system
	prm.args_init(prm.args_known_default, args, "fr")
	-- local Argtest = { options = " debug fr docavant ", "Rimbaud", "Arthur", "1234", droits = "70", pays = "France" }
	if ArgXXXtest ~= nil then
		local t = prm.args_import_all(Argtest) -- rq.argts.args_import_all(args_src, args_kwn)
		t = t..rq.argts.generDoc("") -- Documentation des arguments dés leur lecture
		return t
	end
	arg_lang = "en"
	-- Generate wikitext and others
	local ntc = HTMLnotice(control, data, ref, noticeN)
	return ntc
end -- p.notice(frame)

-- Alias pour Interface pour générer une notice d'autorité indépendante sur une personne, un livre ou autre.
function p.nt(frame)
	return p.notice(frame)
end -- p.nt(frame)

return p