Wikiorðabók
iswiktionary
https://is.wiktionary.org/wiki/Wikior%C3%B0ab%C3%B3k:Fors%C3%AD%C3%B0a
MediaWiki 1.47.0-wmf.17
case-sensitive
Miðill
Kerfissíða
Spjall
Notandi
Notandaspjall
Wikiorðabók
Wikiorðabókarspjall
Mynd
Myndaspjall
Melding
Meldingarspjall
Snið
Sniðaspjall
Hjálp
Hjálparspjall
Flokkur
Flokkaspjall
Viðauki
Viðaukaspjall
Samheitasafn
Samheitasafnsspjall
Skjátexti
Skjátextaspjall
Module
Module talk
Event
Event talk
verða
0
5876
392458
392409
2026-08-30T11:13:02Z
Ow! That Hurts!
8952
392458
wikitext
text/x-wiki
==Íslenska==
{{Sagnbeyging|
ég-nútíð=[[verð]]
|þú-nútíð=[[verður]]
|hann-nútíð=[[verður]]
|við-nútíð=[[verðum]]
|þið-nútíð=[[verðið]]
|þeir-nútíð=[[verða]]
|Þátíð=[[varð]]
|Lýsingarháttur þátíðar=[[orðið]]
|Viðtengingarháttur=[[verði]]
|Boðháttur=[[vertu]]
|allar sagnbeygingar=verða/sagnbeyging
}}
===Aðrar orðmyndir===
* [[verda]] (''fyrir Ð'')
===Sagnorð===
'''verða'''; {{so.s.b.}} {{hjálparsögn-is}}
# (''[[w:tengisögn|tengisögn]]'') fara í eitthvert ástand; [[gera|gerast]], [[breytast í]] {{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|tegund=tímarit|höfundur=[[w:Carl Christian Rafn|Carl Christian Rafn]]|höf-hnekkja=[[w:Carl Christian Rafn|Rafn]]|dags=10. apríl 1826|titill=Fornaldar Sögur Norðrlanda|tímarit=Frèttir|útgáfustaður=[[w:Kaupmannahöfn|Kaupmannahöfn]]|síður=[https://timarit.is/page/1992949?iabr=on#page/n87/mode/2up síða 88]}}
# (''[[w:háttarsögn|háttarsögn]]'') [[gera]] sem boðorð eða fyrirmæli til að framkvæma setningarumsögnina, en ef það er ekki gert hefur það í för með sér mistök eða neikvæðar afleiðingar; [[þurfa]], [[hljóta]], [[mega til]]
# [[koma fyrir]]
# (''í [[w:Tíðbeyging sagna|nútíð]]'') ''framtíð af'' [[vera]]
====Orðsifjafræði====
Úr [[w:Norræna|norrænu]] [[verða#Norræna|''verða'']], úr [[w:Frumgermanska|frumgermönsku]] ''[[*werþaną]]'' (með sömu orðskýringum), úr [[w:Frumindóevrópska|frumindóevrópsku]] ''[[*wert-]]'' (snúa). Frumindóevrópska orðskýringin „snúa“ þróaðist yfir í frumgermönsku með því að fyrst færast yfir í „snúa í“ og upprunalega orðskýringin var líklega þegar glatuð í frumgermönsku (finnst ekki í neinum germönskum tungumálum).<ref>Vladimir Orel (2003), „*werþanan“, í ''A Handbook of Germanic Etymology'' [Handbók um germanska orðsifjafræði], [[w:Leiden|Leiden]], [[w:Boston|Boston]]: Brill, [https://archive.org/details/Orel-AHandbookOfGermanicEtymology/page/n495/mode/2up síður 457–458]</ref><ref>Guus Kroonen (2013), „*werþan-“, í ''Etymological Dictionary of Proto-Germanic'' [''Orðsifjafræðileg orðabók frumgermönsku''] (Leiden Indo-European Etymological Dictionary Series [Indóevrópska orðsifjaorðabókaröð Leiden]; 11), [[w:Leiden|Leiden]], [[w:Boston|Boston]]: Brill, [https://archive.org/details/etymological-dictionary-of-proto-germanic/page/580/mode/2up síður 581–582]</ref>
====Orðtök, orðasambönd====
[[verði þér að góðu]], [[verða að]], [[verða af]], [[verða á]], [[verða eftir]], [[verða fyrir]], [[verða ofan á]], [[verða til]], [[verða um]], [[verða undir]], [[verða úr]], [[verða úti]], [[verða við]]
====Þýðingar====
{{þýðingar|gerast
|en= {{þýðing|en|become}}
|cs= {{þýðing|cs|stát se}}
|de= {{þýðing|de|werden}}
}}
{{þýðingar|þurfa
|da= {{þýðing|da|måtte}}, {{þýðing|da|skulle}}
|no= {{þýðing|no|måtte}}
|nb= {{þýðing|nb|måtta}}
|sv= {{þýðing|sv|måste}}
|fo= {{þýðing|fo|skula}}, {{þýðing|fo|mega}}, {{þýðing|fo|noyðast}}
|en= {{þýðing|en|must}}
|es= {{þýðing|es|deber}}, {{þýðing|es|tener que}}
|cs= {{þýðing|cs|muset}}
|de= {{þýðing|de|müssen}}, {{þýðing|de|sollen}}
}}
{{þýðingar|koma fyrir
|en= {{þýðing|en|occur}}
|de= {{þýðing|de|geschehen}}
}}
{{þýðingar|''framtíð af'' vera
|en= [[will#Enska|will]] [[be#Enska|be]]
|de= {{þýðing|de|werden}}
}}
===Tilvísun===
<references/>
{{Ref-Orðabók Háskólans|ver%F0a}}
{{Ref-IcelandicOnlineDictionary|verða}}
{{Ref-Islex|45122|verða}}
pldrzl3bccx27ag6ubvffn99dklgjhk
abbadís
0
15816
392443
392428
2026-08-30T08:39:47Z
Ow! That Hurts!
8952
392443
wikitext
text/x-wiki
==Íslenska==
{{Fallbeyging kvk sb 01|abbadís}}
[[File:Catherine of Sweden (1244) effigy 1905.jpg|thumb|Mynd Katrínar Súnadóttur, einu sinni drottning Svíþjóðar sem gerðist '''abbadís''' eftir að hún varð ekkja, á gröf sinni.]]
===Nafnorð===
'''abbadís''' {{kvk.}}; {{no.s.b.}}
# forstöðukona [[nunnuklaustur]]s {{stenst á|is|ábóti}}<!---
---> {{tilvitnun|is|lítill=að verða abbadís í klaustri nokkru|margur=[[fjellzt|Fjellzt]] hún á þá uppástungu bróðir síns, að verða abbadís í klaustri nokkru, er lá á bakka Rínfljótsins skammt frá kastala föður hennar.|höf=[[w:Steingrímur Thorsteinsson|Thorsteinsson]]|árið=1859|fhöf=[[w:Steingrímur Thorsteinsson|Steingrímur Thorsteinsson]]|dag=1. janúar 1859|ftil=„Hólmgangan“, í ''Ný sumargjöf'', [[w:Kaupmannahöfn|Kaupmannahöfn]]: forlag [[w:Páll Sveinsson|Páls Sveinssonar]], [https://timarit.is/page/2037460?iabr=on síður 8–9]}}<!---
---> {{tilvitnun|is|lítill=hann læknaði … frakkneska abbadís|margur=[[þykir|Þykir]] hann hafa unnið til þess á margan hátt, en sjer [[í lagí]] fyrir það, að hann læknaði í sumar frakkneska abbadís með kraptaverki.|höf=[[w:Björn Jónsson|Jónsson]]|árið=1876|fhöf=[[w:Björn Jónsson|Björn Jónsson]]|dag=28. desember 1876|ftil=„Hitt og þetta“, í ''[[w:Ísafold|Ísafold]]'', 3. árgangur, 31. tölublað, [[w:Reykjavík|Reykjavík]]: Landsprentsmiðjan, [https://timarit.is/page/3939551?iabr=on síða 124]}}<!---
---> {{tilvitnun|is|lítill=skildi Halldóra abbadís senda menn norður|margur=[[var|Var]] för hans þangað ráðin, og skildi Halldóra abbadís senda menn norður í móti honum um sumarið.|höf=Helgadóttir|árið=1961|fhöf=Guðrún Pálína Helgadóttir|ftil=''Skáldkonur fyrri alda'', Kvöldvökuútgáfan, [https://www.google.com/books/edition/Sk%C3%A1ldkonur_fyrri_alda/nuMuAAAAIAAJ?hl=de&gbpv=1&bsq=%22abbad%C3%ADs%22&dq=%22abbad%C3%ADs%22&printsec=frontcover síða 82]}}<!---
---> {{tilvitnun|is|lítill=Jeronímus … segir frá að hafi fylgt abbadís sinni í kirkju|margur=[[hvað|Hvað]] myndi [[t.d.]] gerast með þær nunnur sem Jeronímus í Betlehem segir frá að hafi fylgt abbadís sinni í kirkju á sunnudegi og því næst [[til baka]] til vistarvera sinna og notað það sem eftir var af deginum [[til að]] inna af hendi störf sín við að búa til fatnað annað hvort handa sér eða öðrum?|höf=Snorrason|árið=2016|fhöf=Kenneth Andrew Strand|dag=janúar 1979|ftil=„How Sunday Became the Popular Day of Worship: Part 3 [Hvernig sunnudagur varð vinsæll tilbeiðsludagur: 3. hluti]“, í ''These Times'' [''Þessir tímar''], [https://documents.adventistarchives.org/Periodicals/WM/WM19790101-V88-01.pdf síður 12–15]; þýtt sem “Sunnudagurinn”, í {{hástafir|Erling B. Snorrason}}, ritstjóri, ''Aðventfréttir'', 82. árgangur, 1. tölublað, [[w:Reykjavík|Reykjavík]]: [[w:Kirkja sjöunda dags aðventista|Kirkja sjöunda dags aðventista á Íslandi]], janúar/febrúar 2016, [https://timarit.is/page/7356506?iabr=on síða 16]}}<!---
---> {{tilvitnun|is|lítill=[[hún|Hún]] var … abbadís|margur=[[á|Á]] 12. öld var uppi kona í Þýskalandi og var henni margt til lista lagt. [[hún|Hún]] var guðfræðingur, nunna og abbadís, dulspekingur og prédikari, ljóðskáld og rithöfundur, náttúrufræðingur, lyfjafræðingur, myndlistarmaður og síðast en ekki síst tónskáld. [[hvað|Hvað]] hét þessi fjölhæfa kona?|höf=[[w:Illugi Jökulsson|Jökulsson]]|fhöf=[[w:Illugi Jökulsson|Illugi Jökulsson]]|árið=2021|dag=29. janúar 2021|ftil=„[https://heimildin.is/grein/12819/ 278. spurningaþraut: Stór höf, Rúm eru hættuleg, Noregskóngur og fræg abbadís]“, í ''[[w:Heimildin|Heimildin]]''}}<!---
---> {{s.e.|+=já}} [[biskup]], [[klausturfólk]], [[munkur]], [[nunna]], [[páfi]]
# (''staðbundið'') [[óknyttakvendi]], [[harðduglegur|harðdugleg]] kona
====Orðsifjafræði====
Erft úr [[w:norræna|norrænu]] ''[[abbadís#Norræna|abbadís]]'', sem er önnur orðmynd af norrænu ''[[abbatissa#Norræna|abbatissa]]''/''[[abbadissa#Norræna|abbadissa]]''. Samkvæmt Magnússyni (1989) og Schmid (2001) er norræna ''abbatissa'' sjálft annaðhvort:
* fengið úr [[w:Fornenska|fornensku]] og [[w:Miðlágþýska|miðlágþýsku]] ''[[abbadisse]]'', fengið úr [[w:Latína|latnesku]] ''[[abbatissa]]'';
* fegnið beint úr latnesku ''abbatissa''.
{{-þýðingar-}}
{{þýðingar
|en= {{þýðing|en|abbess}}
|fi= {{þýðing|fi|abbedissa}}
|grc= {{þýðing|grc|ἡγουμένη}}
|fr= {{þýðing|fr|abbesse}}
|el= {{þýðing|el|ηγουμένη}}
|nl= {{þýðing|nl|abdis}}
|it= {{þýðing|it|badessa}}, {{þýðing|it|abadessa}}, {{þýðing|it|abbadessa}}
|ca= {{þýðing|ca|abadessa}}
|la= {{þýðing|la|abbātissa}}
|no= {{þýðing|no|abbedisse}}
|pt= {{þýðing|pt|abadessa}}
|ro= {{þýðing|ro|egumenă}}, {{þýðing|ro|stareţă}}
|ru= {{þýðing|ru|игуменья}}, {{þýðing|ru|аббатиса}}, {{þýðing|ru|настоятельница монастыря}}
|es= {{þýðing|es|abadesa}}
|sv= {{þýðing|sv|abbedissa}}
|de= {{þýðing|de|Äbtissin}}
}}
{{-tilvísun-}}
{{Wikipedia|abbadís}}
{{Ref-Orðabók Háskólans|abbad%EDs}}
5kp1od1wtjx8xgxg6ius45bzj8b8onx
392462
392443
2026-08-30T11:36:36Z
Ow! That Hurts!
8952
392462
wikitext
text/x-wiki
==Íslenska==
{{Fallbeyging kvk sb 01|abbadís}}
[[File:Catherine of Sweden (1244) effigy 1905.jpg|thumb|Mynd Katrínar Súnadóttur, einu sinni drottning Svíþjóðar sem gerðist '''abbadís''' eftir að hún varð ekkja, á gröf sinni.]]
===Nafnorð===
'''abbadís''' {{kvk.}}; {{no.s.b.}}
# forstöðukona [[nunnuklaustur]]s {{stenst á|is|ábóti}}<!---
---> {{tilvitnun|is|lítill=að verða abbadís í klaustri nokkru|margur=[[fjellzt|Fjellzt]] hún á þá uppástungu bróðir síns, að verða abbadís í klaustri nokkru, er lá á bakka Rínfljótsins skammt frá kastala föður hennar.|tegund=tímarit|höfundur=[[w:Steingrímur Thorsteinsson|Steingrímur Thorsteinsson]]|höf-hnekkja=[[w:Steingrímur Thorsteinsson|Thorsteinsson]]|dags=1. janúar 1859|titill=Hólmgangan|tímarit=Ný sumargjöf|útgáfustaður=[[w:Kaupmannahöfn|Kaupmannahöfn]]|útgefandi=forlag [[w:Páll Sveinsson|Páls Sveinssonar]]|síður=[https://timarit.is/page/2037460?iabr=on síður 8–9]}}<!---
---> {{tilvitnun|is|lítill=hann læknaði … frakkneska abbadís|margur=[[þykir|Þykir]] hann hafa unnið til þess á margan hátt, en sjer [[í lagí]] fyrir það, að hann læknaði í sumar frakkneska abbadís með kraptaverki.|höfundur=[[w:Björn Jónsson|Björn Jónsson]]|höf-hnekkja=[[w:Björn Jónsson|Jónsson]]|dags=28. desember 1876|tegund=tímarit|titill=Hitt og þetta|tímarit=[[w:Ísafold|Ísafold]]|árgangur=3|tölublað=31|útgáfustaður=[[w:Reykjavík|Reykjavík]]|útgefandi=Landsprentsmiðjan|síður=[https://timarit.is/page/3939551?iabr=on síða 124]}}<!---
---> {{tilvitnun|is|lítill=skildi Halldóra abbadís senda menn norður|margur=[[var|Var]] för hans þangað ráðin, og skildi Halldóra abbadís senda menn norður í móti honum um sumarið.|tegund=bók|ár=1961|höfundur=Guðrún Pálína Helgadóttir|titill=Skáldkonur fyrri alda|útgefandi=Kvöldvökuútgáfan|síður=[https://www.google.com/books/edition/Sk%C3%A1ldkonur_fyrri_alda/nuMuAAAAIAAJ?hl=de&gbpv=1&bsq=%22abbad%C3%ADs%22&dq=%22abbad%C3%ADs%22&printsec=frontcover síða 82]}}<!---
---> {{tilvitnun|is|lítill=Jeronímus … segir frá að hafi fylgt abbadís sinni í kirkju|margur=[[hvað|Hvað]] myndi [[t.d.]] gerast með þær nunnur sem Jeronímus í Betlehem segir frá að hafi fylgt abbadís sinni í kirkju á sunnudegi og því næst [[til baka]] til vistarvera sinna og notað það sem eftir var af deginum [[til að]] inna af hendi störf sín við að búa til fatnað annað hvort handa sér eða öðrum?|höfundur=Kenneth Andrew Strand|dags=janúar 1979|tegund=tímarit|titill=How Sunday Became the Popular Day of Worship: Part 3<þ:Hvernig sunnudagur varð vinsæll tilbeiðsludagur: 3. hluti>|tímarit=These Times<þ:Þessir tímar>|síður=[https://documents.adventistarchives.org/Periodicals/WM/WM19790101-V88-01.pdf síður 12–15]|tegund-2=tímarit|titill-2=Sunnudagurinn|ritstjóri-2=Erling B. Snorrason|tímarit=Aðventfréttir|árgangur-2=82|tölublað-2=1|útgáfustaður-2=[[w:Reykjavík|Reykjavík]]|útgefandi-2=[[w:Kirkja sjöunda dags aðventista|Kirkja sjöunda dags aðventista á Íslandi]]|dags-2=janúar/febrúar 2016|síður-2=[https://timarit.is/page/7356506?iabr=on síða 16]|höf-hnekkja=Snorrason|ár-hnekkja=2016}}<!---
---> {{tilvitnun|is|lítill=[[hún|Hún]] var … abbadís|margur=[[á|Á]] 12. öld var uppi kona í Þýskalandi og var henni margt til lista lagt. [[hún|Hún]] var guðfræðingur, nunna og abbadís, dulspekingur og prédikari, ljóðskáld og rithöfundur, náttúrufræðingur, lyfjafræðingur, myndlistarmaður og síðast en ekki síst tónskáld. [[hvað|Hvað]] hét þessi fjölhæfa kona?|tegund=tímarit|höf-hnekkja=[[w:Illugi Jökulsson|Jökulsson]]|höfundur=[[w:Illugi Jökulsson|Illugi Jökulsson]]|dags=29. janúar 2021|titill=[https://heimildin.is/grein/12819/ 278. spurningaþraut: Stór höf, Rúm eru hættuleg, Noregskóngur og fræg abbadís]|tímarit=[[w:Heimildin|Heimildin]]}}<!---
---> {{s.e.|+=já}} [[biskup]], [[klausturfólk]], [[munkur]], [[nunna]], [[páfi]]
# (''staðbundið'') [[óknyttakvendi]], [[harðduglegur|harðdugleg]] kona
====Orðsifjafræði====
Erft úr [[w:norræna|norrænu]] ''[[abbadís#Norræna|abbadís]]'', sem er önnur orðmynd af norrænu ''[[abbatissa#Norræna|abbatissa]]''/''[[abbadissa#Norræna|abbadissa]]''. Samkvæmt Magnússyni (1989) og Schmid (2001) er norræna ''abbatissa'' sjálft annaðhvort:
* fengið úr [[w:Fornenska|fornensku]] og [[w:Miðlágþýska|miðlágþýsku]] ''[[abbadisse]]'', fengið úr [[w:Latína|latnesku]] ''[[abbatissa]]'';
* fegnið beint úr latnesku ''abbatissa''.
{{-þýðingar-}}
{{þýðingar
|en= {{þýðing|en|abbess}}
|fi= {{þýðing|fi|abbedissa}}
|grc= {{þýðing|grc|ἡγουμένη}}
|fr= {{þýðing|fr|abbesse}}
|el= {{þýðing|el|ηγουμένη}}
|nl= {{þýðing|nl|abdis}}
|it= {{þýðing|it|badessa}}, {{þýðing|it|abadessa}}, {{þýðing|it|abbadessa}}
|ca= {{þýðing|ca|abadessa}}
|la= {{þýðing|la|abbātissa}}
|no= {{þýðing|no|abbedisse}}
|pt= {{þýðing|pt|abadessa}}
|ro= {{þýðing|ro|egumenă}}, {{þýðing|ro|stareţă}}
|ru= {{þýðing|ru|игуменья}}, {{þýðing|ru|аббатиса}}, {{þýðing|ru|настоятельница монастыря}}
|es= {{þýðing|es|abadesa}}
|sv= {{þýðing|sv|abbedissa}}
|de= {{þýðing|de|Äbtissin}}
}}
{{-tilvísun-}}
{{Wikipedia|abbadís}}
{{Ref-Orðabók Háskólans|abbad%EDs}}
49sq492nqzjvds02x0iokra4lde7ys0
eplavín
0
21660
392431
340505
2026-08-29T17:04:54Z
~2026-47166-41
9709
392431
wikitext
text/x-wiki
{{-is-}}
{{-is-nafnorð-}}
{{Fallbeyging hk sb 01|eplavín}}
'''eplavín''' {{hk.}}; {{no.s.b.}}
:[1] [[áfengur]] [[drykkur]] úr safa af eplum
{{-orðsifjafræði-}}
:[[epli|epla]]- og [[vín]]
{{-þýðingar-}}
{{þýðingar
|af= {{þýðing|af|appelwyn}}
|da= {{þýðing|da|æblevin}}
|en= {{þýðing|en|cider}}
|it= {{þýðing|it|sidro}}
|fr= {{þýðing|fr|cidre}}
|nl= {{þýðing|nl|appelwijn}}, {{þýðing|nl|cider}}
|no= {{þýðing|no|sider}}
|pt= {{þýðing|pt|cidra}}
|es= {{þýðing|es|sidra}}
|de= {{þýðing|de|Apfelwein}}, {{þýðing|de|Cidre}}
<!-- |zh= {{þýðing|zh|苹果酒}} -->
}}
{{-tilvísun-}}
{{Wikipedia|eplavín}}
{{Ref-IcelandicOnlineDictionary|eplavín}}
{{Ref-Orðabók Háskólans|eplav%EDn}}
f36c4cdqmblqxdduyqhmav459pqpwpb
mænir
0
28664
392433
281092
2026-08-29T17:09:05Z
~2026-47166-41
9709
392433
wikitext
text/x-wiki
{{-is-}}
{{Stubbur}}
<!--
{{Fallbeyging (tímabundin)|
1eó=mænir
|1eá=
|1fó=
|1fá=
|2eó=
|2eá=
|2fó=
|2fá=
|3eó=
|3eá=
|3fó=
|3fá=
|4eó=
|4eá=
|4fó=
|4fá=
}} -->
{{-is-nafnorð-}}
'''mænir''' {{kk.}}
:[1] [[]]
:[2] [[skjár]]
{{-þýðingar-}}
{{þýðingar
|en= {{þýðing|en|ridge|1}}, {{þýðing|en|monitor|2}}, {{þýðing|en|screen|2}}
|de= {{þýðing|de|}}
|es= {{þýðing|es|pantalla|2}}, {{þýðing|es|monitor|2}}
|ca= {{þýðing|ca|}}
}}
{{-tilvísun-}}
{{Wikipedia|mænir}}
{{Ref-IcelandicOnlineDictionary|mænir}}
{{Ref-Orðabók Háskólans|m%E6nir}}
dgvbcthktxvaarf9hyjepgzwkexab7c
blåbær
0
63308
392440
315405
2026-08-30T06:08:20Z
Ow! That Hurts!
8952
/* */
392440
wikitext
text/x-wiki
{{s.e.}} [[blåbär]]
==Danska==
===Nafnorð===
'''blåbær''' {{hk.}}
# [[aðalbláber]]; ''Vaccinium myrtillus''
==Norska==
===Nafnorð===
'''blåbær''' {{hk.}} ''[[w:Bókmál|Bókmál]], Ríkismál og [[w:Nýnorska|Nýnorska]]''
# [[aðalbláber]]; ''Vaccinium myrtillus''
oitq116hxp6gul3mfzp02xfa9amt3bx
Heft
0
65822
392432
354864
2026-08-29T17:07:26Z
~2026-47166-41
9709
392432
wikitext
text/x-wiki
{{-de-}}
{{-de-nafnorð-}}
{{Fallbeyging de|Heft|Hefts, Heftes|Heft, Hefte|Heft|Hefte|Hefte|Heften|Hefte}}
'''Heft''' {{hk.}}
:[1] [[hefti]]
:[2] [[stilabók]]
{{-orðsifjafræði-}}
:{{orðhlutar|Heft}}
{{-framburður-}}
:{{IPA|[hɛft]}}
:{{hljóðskrá|De-Heft2.ogg}}
{{-tilvísun-}}
{{Wikipedia|de:Heft (Papier)|Heft (Papier)}}
{{Wikipedia|de:Heft (Griffstück)|Heft (Griffstück)}}
8u7ack9yn195k9bs3ts8y2e07or70gs
Dinger
0
115725
392429
387700
2026-08-29T12:17:24Z
Jeuwre
5922
orðsifjafræði, framburður
392429
wikitext
text/x-wiki
{{-de-}}
{{-de-nafnorð-}}
{{Fallbeyging de|-|-|-|-|Dinger|Dingern|Dinger|Dinger}}
'''Dinger''' {{ft.}}
:[[tútta]]
{{-orðsifjafræði-}}
:{{orðhlutar|Din|ger}}
{{-framburður-|de}}
:{{IPA|[ˈdɪŋɐ]}}
:{{hljóðskrá|De-Dinger2.ogg}}
:{{hljóðskrá|De-Dinger.ogg}}
hhaqzyjgim6bgak2eff790ssg6d6xj2
Ding
0
115726
392430
387702
2026-08-29T13:29:17Z
Jeuwre
5922
framburður
392430
wikitext
text/x-wiki
{{-de-}}
{{-de-nafnorð-}}
{{Fallbeyging de|Ding|Dings, Dinges|Ding, Dinge|Ding|Dinge, Dinger|Dinge, Dinger|Dingen, Dingern|Dinge, Dinger}}
'''Ding''' {{hk.}}
:[1] [[hlutur]]
:[2] (bara eintala): [[reður]]
{{-orðsifjafræði-}}
:{{orðhlutar|Ding}}
{{-framburður-|de}}
:{{IPA|[ˈdɪŋ]}}
:{{hljóðskrá|De-Ding2.ogg}}
:{{hljóðskrá|De-Ding.ogg}}
{{-tilvísun-}}
:{{Wikipedia|de:Ding|Ding}}
:{{Ref-Duden|Ding}}
kb66ua1qm0daagewk1ba8t7ojiee5ch
Module:tilvitnun
828
118910
392463
392425
2026-08-30T11:41:31Z
Ow! That Hurts!
8952
392463
Scribunto
text/plain
local p = {}
-- Helper function to capitalize the first letter of a string safely using mw.ustring
local function capitalizeFirst(str)
if not str or str == "" then return "" end
local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1))
local rest = mw.ustring.sub(str, 2)
return first .. rest
end
-- Helper function to process a text passage into linked/bolded tokens
local function processText(text, lang, args, currentPage, addBullet)
if not text or text == "" then return "" end
local wordCounts = {}
local tokens = {}
local isFirstToken = true
-- Phase 1: Group chunks together if they are inside a wikilink (to support multi-word links)
local rawChunks = {}
local currentToken = ""
local inLink = false
for chunk in string.gmatch(text, "%S+%s*") do
if not inLink then
local opens = select(2, string.gsub(chunk, "%[%[", ""))
local closes = select(2, string.gsub(chunk, "%]%]", ""))
if opens > closes then
inLink = true
currentToken = chunk
else
table.insert(rawChunks, chunk)
end
else
currentToken = currentToken .. chunk
local opens = select(2, string.gsub(currentToken, "%[%[", ""))
local closes = select(2, string.gsub(currentToken, "%]%]", ""))
if closes >= opens then
inLink = false
table.insert(rawChunks, currentToken)
currentToken = ""
end
end
end
if inLink then table.insert(rawChunks, currentToken) end
-- Phase 2: Process the collected tokens
for _, chunk in ipairs(rawChunks) do
-- Extract the token and any trailing spaces attached to it
local token, space = string.match(chunk, "^(.-)(%s*)$")
if token and token ~= "" then
local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$")
if innerLink and innerLink ~= "" then
local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$")
if not linkTarget then
linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$")
linkDisplay = linkTarget
end
local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage))
local processedLink = ""
if isPageMatch then
processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay)
else
local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]')
if formatted == innerLink then
formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]')
end
processedLink = formatted
end
local formattedToken = ""
if leadingPunct and leadingPunct ~= "" then
formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct)
end
formattedToken = formattedToken .. processedLink
if trailingPunct and trailingPunct ~= "" then
formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct)
end
if isFirstToken and addBullet then
formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken)
isFirstToken = false
end
table.insert(tokens, formattedToken)
else
if mw.ustring.match(token, "^[%p]+$") then
local puncToken = string.format('<span style="color:#999999;">%s</span>', token)
if isFirstToken and addBullet then
puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken)
isFirstToken = false
end
table.insert(tokens, puncToken)
else
local leadingPunct = mw.ustring.match(token, "^([%p]+)") or ""
local trailingPunct = mw.ustring.match(token, "([%p]+)$") or ""
local coreWord = token
if leadingPunct ~= "" then
coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1)
end
if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then
coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct))
end
if not coreWord or coreWord == "" then
coreWord = token
leadingPunct = ""
trailingPunct = ""
end
wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1
local index = wordCounts[coreWord]
local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord
local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage))
local processedWord = ""
if isPageMatch then
processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord)
else
if lang ~= "" then
local capitalizedLang = capitalizeFirst(lang)
processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord)
else
processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord)
end
end
local finalFormatted = ""
if leadingPunct and leadingPunct ~= "" then
finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct)
end
finalFormatted = finalFormatted .. processedWord
if trailingPunct and trailingPunct ~= "" then
finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct)
end
if isFirstToken and addBullet then
finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted)
isFirstToken = false
end
table.insert(tokens, finalFormatted)
end
end
if space and space ~= "" then
table.insert(tokens, space)
end
elseif space and space ~= "" then
table.insert(tokens, space)
end
end
return table.concat(tokens)
end
function p.main(frame)
local args = frame:getParent().args
local lang = args[1] or ""
local text = args[2] or ""
if text == "" then
text = args[1] or ""
lang = ""
end
if text == "" then
return ""
end
local currentPage = mw.title.getCurrentTitle().text
local litillText = args["litill"] or args["lítill"]
local margurText = args["margur"]
local pText = args["þ"]
local addBullet = not (args["enginn depill"] or args["enginn_depill"])
if litillText or margurText then
local processedLitill = processText(litillText, lang, args, currentPage, addBullet)
local processedMargur = processText(margurText, lang, args, currentPage, addBullet)
if pText and pText ~= "" then
processedLitill = processedLitill .. string.format(' <span style="color:#999999;"><i>%s</i></span>', pText)
processedMargur = processedMargur .. string.format(' <span style="color:#999999;"><i>%s</i></span>', pText)
end
-- Preprocess the #invoke call to safely execute Module:slembitölugjafi.
local randomNumber = frame:preprocess('{{#invoke:slembitölugjafi|main}}')
return frame:expandTemplate{
title = "stutt tilvitnun",
args = {
randomNumber,
processedLitill,
processedMargur
}
}
else
local result = processText(text, lang, args, currentPage, addBullet)
if pText and pText ~= "" then
result = result .. string.format(' <span style="color:#999999;"><i>%s</i></span>', pText)
end
return result
end
end
return p
izha88udnboys7o075qzkprs4p7fkte
Snið:tilvitnun
10
118911
392456
392422
2026-08-30T11:12:11Z
Ow! That Hurts!
8952
392456
wikitext
text/x-wiki
{{#invoke:tilvitnun|main}} {{#invoke:tilvitnun-stil|main}}<noinclude>
==Breytur==
<code><nowiki>{{{1}}}</nowiki></code> — tungumálakóði
<code><nowiki>{{{2}}}</nowiki></code>, <code><nowiki>{{{lítill}}}</nowiki></code>, <code><nowiki>{{{margur}}}</nowiki></code> — texti
<code><nowiki>{{{höfundur}}}</nowiki></code>, <code><nowiki>{{{höf}}}</nowiki></code>, <code><nowiki>{{{fullur höfundur}}}</nowiki></code>, <code><nowiki>{{{fhöf}}}</nowiki></code>
<code><nowiki>{{{árið}}}</nowiki></code>, <code><nowiki>{{{ár}}}</nowiki></code>, <code><nowiki>{{{dagsetning}}}</nowiki></code>, <code><nowiki>{{{dag}}}</nowiki></code>
<code><nowiki>{{{full tilvitnun}}}</nowiki></code>, <code><nowiki>{{{ftil}}}</nowiki></code>
<code><nowiki>{{{engin depill}}}</nowiki></code>
==Dæmi==
# <code><nowiki>{{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|tegund=tímarit|höfundur=[[w:Carl Christian Rafn|]]|höf-hnekkja=[[w:Carl Christian Rafn|Rafn]]|dags=10. apríl 1826|titill=Fornaldar Sögur Norðrlanda|tímarit=Frèttir|útgáfustaður=[[w:Kaupmannahöfn|]]|síður=[https://timarit.is/page/1992949?iabr=on#page/n87/mode/2up síða 88]}}</nowiki></code>
#: {{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|tegund=tímarit|höfundur=[[w:Carl Christian Rafn|Carl Christian Rafn]]|höf-hnekkja=[[w:Carl Christian Rafn|Rafn]]|dags=10. apríl 1826|titill=Fornaldar Sögur Norðrlanda|tímarit=Frèttir|útgáfustaður=[[w:Kaupmannahöfn|Kaupmannahöfn]]|síður=[https://timarit.is/page/1992949?iabr=on#page/n87/mode/2up síða 88]}}
</noinclude>
mvek4r4vp9uf4n77324mfxu8zwzvz0q
392457
392456
2026-08-30T11:12:24Z
Ow! That Hurts!
8952
392457
wikitext
text/x-wiki
{{#invoke:tilvitnun|main}} {{#invoke:tilvitnun-stil|main}}<noinclude>
==Dæmi==
# <code><nowiki>{{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|tegund=tímarit|höfundur=[[w:Carl Christian Rafn|]]|höf-hnekkja=[[w:Carl Christian Rafn|Rafn]]|dags=10. apríl 1826|titill=Fornaldar Sögur Norðrlanda|tímarit=Frèttir|útgáfustaður=[[w:Kaupmannahöfn|]]|síður=[https://timarit.is/page/1992949?iabr=on#page/n87/mode/2up síða 88]}}</nowiki></code>
#: {{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|tegund=tímarit|höfundur=[[w:Carl Christian Rafn|Carl Christian Rafn]]|höf-hnekkja=[[w:Carl Christian Rafn|Rafn]]|dags=10. apríl 1826|titill=Fornaldar Sögur Norðrlanda|tímarit=Frèttir|útgáfustaður=[[w:Kaupmannahöfn|Kaupmannahöfn]]|síður=[https://timarit.is/page/1992949?iabr=on#page/n87/mode/2up síða 88]}}
</noinclude>
01ttgg20ngh41i6b52t2ivs1ds9qf6x
392461
392457
2026-08-30T11:33:46Z
Ow! That Hurts!
8952
392461
wikitext
text/x-wiki
{{#invoke:tilvitnun|main}} {{#invoke:tilvitnun-stil|main}}<noinclude>
==Dæmi==
# <code><nowiki>{{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|tegund=tímarit|höfundur=[[w:Carl Christian Rafn|]]|höf-hnekkja=[[w:Carl Christian Rafn|Rafn]]|dags=10. apríl 1826|titill=Fornaldar Sögur Norðrlanda|tímarit=Frèttir|útgáfustaður=[[w:Kaupmannahöfn|]]|síður=[https://timarit.is/page/1992949?iabr=on#page/n87/mode/2up síða 88]}}</nowiki></code>
#: {{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|tegund=tímarit|höfundur=[[w:Carl Christian Rafn|Carl Christian Rafn]]|höf-hnekkja=[[w:Carl Christian Rafn|Rafn]]|dags=10. apríl 1826|titill=Fornaldar Sögur Norðrlanda|tímarit=Frèttir|útgáfustaður=[[w:Kaupmannahöfn|Kaupmannahöfn]]|síður=[https://timarit.is/page/1992949?iabr=on#page/n87/mode/2up síða 88]}}
# <code><nowiki>{{tilvitnun|is|lítill=Jeronímus … segir frá að hafi fylgt abbadís sinni í kirkju|margur=[[hvað|Hvað]] myndi [[t.d.]] gerast með þær nunnur sem Jeronímus í Betlehem segir frá að hafi fylgt abbadís sinni í kirkju á sunnudegi og því næst [[til baka]] til vistarvera sinna og notað það sem eftir var af deginum [[til að]] inna af hendi störf sín við að búa til fatnað annað hvort handa sér eða öðrum?|höfundur=Kenneth Andrew Strand|dags=janúar 1979|tegund=tímarit|titill=How Sunday Became the Popular Day of Worship: Part 3<þ:Hvernig sunnudagur varð vinsæll tilbeiðsludagur: 3. hluti>|tímarit=These Times<þ:Þessir tímar>|síður=[https://documents.adventistarchives.org/Periodicals/WM/WM19790101-V88-01.pdf síður 12–15]|tegund-2=tímarit|titill-2=Sunnudagurinn|ritstjóri-2=Erling B. Snorrason|tímarit=Aðventfréttir|árgangur-2=82|tölublað-2=1|útgáfustaður-2=[[w:Reykjavík|]]|útgefandi-2=[[w:Kirkja sjöunda dags aðventista|Kirkja sjöunda dags aðventista á Íslandi]]|dags-2=janúar/febrúar 2016|síður-2=[https://timarit.is/page/7356506?iabr=on síða 16]|höf-hnekkja=Snorrason|ár-hnekkja=2016|enginn depill=já}}</nowiki></code>
#: {{tilvitnun|is|lítill=Jeronímus … segir frá að hafi fylgt abbadís sinni í kirkju|margur=[[hvað|Hvað]] myndi [[t.d.]] gerast með þær nunnur sem Jeronímus í Betlehem segir frá að hafi fylgt abbadís sinni í kirkju á sunnudegi og því næst [[til baka]] til vistarvera sinna og notað það sem eftir var af deginum [[til að]] inna af hendi störf sín við að búa til fatnað annað hvort handa sér eða öðrum?|höfundur=Kenneth Andrew Strand|dags=janúar 1979|tegund=tímarit|titill=How Sunday Became the Popular Day of Worship: Part 3<þ:Hvernig sunnudagur varð vinsæll tilbeiðsludagur: 3. hluti>|tímarit=These Times<þ:Þessir tímar>|síður=[https://documents.adventistarchives.org/Periodicals/WM/WM19790101-V88-01.pdf síður 12–15]|tegund-2=tímarit|titill-2=Sunnudagurinn|ritstjóri-2=Erling B. Snorrason|tímarit=Aðventfréttir|árgangur-2=82|tölublað-2=1|útgáfustaður-2=[[w:Reykjavík|Reykjavík]]|útgefandi-2=[[w:Kirkja sjöunda dags aðventista|Kirkja sjöunda dags aðventista á Íslandi]]|dags-2=janúar/febrúar 2016|síður-2=[https://timarit.is/page/7356506?iabr=on síða 16]|höf-hnekkja=Snorrason|ár-hnekkja=2016|enginn depill=já}}
</noinclude>
hsdte980b8748af3dpi6th3sya63450
Module:tilvísun
828
118918
392434
2026-08-30T00:08:31Z
Ow! That Hurts!
8952
Bjó til síðu með „local p = {} -- Data table defining rules for each format type local format_rules = { book = { title_format = "italic", container = false, required = {"author", "title", "year"} }, journal = { title_format = "quotes", container = "italic", required = {"title", "journal", "year"} }, video = { title_format = "italic", container = false, required = {"title", "year"} }, hansard = { title_format = "plain", container = "italic", required = {"speaker", "...“
392434
Scribunto
text/plain
local p = {}
-- Data table defining rules for each format type
local format_rules = {
book = { title_format = "italic", container = false, required = {"author", "title", "year"} },
journal = { title_format = "quotes", container = "italic", required = {"title", "journal", "year"} },
video = { title_format = "italic", container = false, required = {"title", "year"} },
hansard = { title_format = "plain", container = "italic", required = {"speaker", "assembly", "date"} },
newsgroup = { title_format = "quotes", container = "plain", required = {"author", "title", "newsgroup", "date"} },
mailinglist = { title_format = "quotes", container = "plain", required = {"author", "title", "list", "date"} },
song = { title_format = "quotes", container = "italic", required = {"artist", "title"} },
patent = { title_format = "plain", container = false, required = {"inventor", "title", "number"} },
game = { title_format = "italic", container = false, required = {"developer", "title", "platform", "year"} },
web = { title_format = "quotes", container = "plain", required = {"title", "url"} }
}
-- Helper function to format strings based on the rules
local function format_text(text, style)
if not text then return nil end
if style == "italic" then
return "''" .. text .. "''"
elseif style == "quotes" then
return "“" .. text .. "”"
end
return text -- plain
end
function p.format_source(frame)
local args = frame:getParent().args
local source_type = args.type or "web" -- Default to web if omitted
local rules = format_rules[source_type]
if not rules then
return "<strong class='error'>Error: Unsupported source type '" .. source_type .. "'.</strong>"
end
-- Check for required arguments
for _, req_arg in ipairs(rules.required) do
if not args[req_arg] or args[req_arg] == "" then
return "<strong class='error'>Error: Missing required parameter '" .. req_arg .. "' for type '" .. source_type .. "'.</strong>"
end
end
local output = {}
-- Example rendering sequence: Author. Title. Container. Date.
if args.author or args.artist or args.inventor or args.speaker or args.developer then
table.insert(output, (args.author or args.artist or args.inventor or args.speaker or args.developer))
end
if args.title then
table.insert(output, format_text(args.title, rules.title_format))
end
-- Handle specialized identifiers
if source_type == "hansard" then
table.insert(output, format_text(args.assembly, rules.container) .. ", col. " .. (args.column or ""))
elseif source_type == "patent" then
table.insert(output, "Patent No. " .. args.number)
elseif source_type == "game" then
table.insert(output, args.platform)
end
return table.concat(output, ". ") .. "."
end
return p
h44xsdyt95aaayfzvnnrs2500q2jdte
392436
392434
2026-08-30T00:15:10Z
Ow! That Hurts!
8952
392436
Scribunto
text/plain
local p = {}
local metadata = mw.loadData('Module:tilvísun/data')
-- Helper: Fetch argument, checking for aliases and cleaning empty strings
local function get_arg(args, key)
local val = args[key]
if not val or val == "" then
-- Check if there's an alias in the metadata that matches
for alias, standard_key in pairs(metadata.aliases) do
if standard_key == key and args[alias] and args[alias] ~= "" then
val = args[alias]
break
end
end
end
if val and val ~= "" then return mw.text.trim(val) end
return nil
end
-- Helper: Apply formatting styles safely
local function apply_style(text, style)
if not text then return "" end
if style == "italic" then return "''" .. text .. "''"
elseif style == "quotes" then return "„" .. text .. "“" end
return text
end
function p.tilvisun(frame)
local args = frame:getParent().args
if not args['höfundur'] and not args['titill'] and not args['author'] then
args = frame.args
end
local tegund = get_arg(args, 'tegund') or "vef"
local rules = metadata.format_rules[tegund] or metadata.format_rules["vef"]
local result = ""
-- 1. Authors (Semicolon separated)
local hofundur = get_arg(args, 'höfundur')
if hofundur then
local authors = {}
for author in string.gmatch(hofundur, "([^;]+)") do
table.insert(authors, mw.text.trim(author))
end
if #authors > 0 then
local author_str = authors[1]
if #authors == 2 then author_str = authors[1] .. " & " .. authors[2]
elseif #authors > 2 then
author_str = ""
for j = 1, #authors do
if j == 1 then author_str = authors[j]
elseif j == #authors then author_str = author_str .. ", & " .. authors[j]
else author_str = author_str .. ", " .. authors[j] end
end
end
if not string.match(author_str, "[%.%?%!]$") then author_str = author_str .. "." end
result = result .. author_str .. " "
end
end
-- 2. Date / Year
local ar = get_arg(args, 'dags') or get_arg(args, 'ár') or 'á.á.'
result = result .. "(" .. ar .. "). "
-- 3. Title & Translated Title
local titill = get_arg(args, 'titill')
if titill then
local thyding = get_arg(args, 'þýðing_titils')
local t_str = apply_style(titill, rules.title_style)
if thyding then t_str = t_str .. " [" .. thyding .. "]" end
if not string.match(t_str, "[%.%?%!%]$]$") and not string.match(t_str, "“$") then
t_str = t_str .. "."
elseif string.match(t_str, "%]$") or string.match(t_str, "“$") then
t_str = t_str .. "."
end
result = result .. t_str .. " "
end
-- 4. Original Container (Journal, Publisher, Volume)
local timarit = get_arg(args, 'tímarit')
if timarit then
result = result .. apply_style(timarit, rules.container_style)
local argangur = get_arg(args, 'árgangur')
if argangur then result = result .. ", ''" .. argangur .. "''" end
local tolublad = get_arg(args, 'tölublað')
if tolublad then result = result .. "(" .. tolublad .. ")" end
local sidur = get_arg(args, 'síður')
if sidur then result = result .. ", " .. sidur end
result = result .. ". "
else
local utgafustadur = get_arg(args, 'útgáfustaður')
local utgefandi = get_arg(args, 'útgefandi')
local pub_details = ""
if utgafustadur then pub_details = utgafustadur end
if utgefandi then
if pub_details ~= "" then pub_details = pub_details .. ": " .. utgefandi
else pub_details = utgefandi end
end
if pub_details ~= "" then result = result .. pub_details .. ". " end
end
-- 5. Secondary Citation (Reprints / Translations / [parameter]2)
local has_part2 = get_arg(args, 'titill2') or get_arg(args, 'tímarit2') or get_arg(args, 'útgefandi2') or get_arg(args, 'dags2')
if has_part2 then
local p2 = get_arg(args, 'tenging') or "Endurprentað í"
local titill2 = get_arg(args, 'titill2')
if titill2 then p2 = p2 .. " „" .. titill2 .. "“" end
local ritstjori2 = get_arg(args, 'ritstjóri2')
local timarit2 = get_arg(args, 'tímarit2')
-- Smart Grammar for "í"
if ritstjori2 or timarit2 then
if titill2 or not string.match(p2, "í$") then p2 = p2 .. ", í "
else p2 = p2 .. " í " end
elseif titill2 then p2 = p2 .. ", " else p2 = p2 .. " " end
p2 = string.gsub(p2, " +", " ")
if ritstjori2 then p2 = mw.text.trim(p2) .. " " .. ritstjori2 .. " (ritstj.), " end
if timarit2 then
p2 = mw.text.trim(p2) .. " ''" .. timarit2 .. "''"
local argangur2 = get_arg(args, 'árgangur2')
if argangur2 then p2 = p2 .. ", ''" .. argangur2 .. "''" end
local tolublad2 = get_arg(args, 'tölublað2')
if tolublad2 then p2 = p2 .. "(" .. tolublad2 .. ")" end
local sidur2 = get_arg(args, 'síður2')
if sidur2 then p2 = p2 .. ", " .. sidur2 end
else
local sidur2 = get_arg(args, 'síður2')
if sidur2 then
p2 = mw.text.trim(p2)
if string.match(p2, ",$") then p2 = p2 .. " " .. sidur2 else p2 = p2 .. ", " .. sidur2 end
end
end
p2 = string.gsub(mw.text.trim(p2), "[,%.]$", "")
if p2 ~= "" then result = result .. p2 .. ". " end
local utgafustadur2 = get_arg(args, 'útgáfustaður2')
local utgefandi2 = get_arg(args, 'útgefandi2')
local dags2 = get_arg(args, 'dags2') or get_arg(args, 'ár2')
local pub2 = ""
if utgafustadur2 then pub2 = utgafustadur2 end
if utgefandi2 then
if pub2 ~= "" then pub2 = pub2 .. ": " .. utgefandi2 else pub2 = utgefandi2 end
end
if dags2 then
if pub2 ~= "" then pub2 = pub2 .. ", " .. dags2 else pub2 = dags2 end
end
if pub2 ~= "" then result = result .. pub2 .. ". " end
end
-- 6. URL and Access Date
local vefslod = get_arg(args, 'vefslóð')
local sott = get_arg(args, 'sótt')
if vefslod then
if sott then result = result .. "Sótt " .. sott .. ", af [" .. vefslod .. " " .. vefslod .. "]"
else result = result .. "[" .. vefslod .. " " .. vefslod .. "]" end
end
return mw.text.trim(result)
end
return p
9796s6aaavh7kycu58p99eegd5tsysp
392437
392436
2026-08-30T00:31:57Z
Ow! That Hurts!
8952
392437
Scribunto
text/plain
local p = {}
local metadata = mw.loadData('Module:APA/data')
-- Helper: Fetch argument with optional suffix (like "-2"), checking aliases
local function get_arg(args, key, suffix)
suffix = suffix or ""
local target_key = key .. suffix
local val = args[target_key]
if not val or val == "" then
-- Check aliases in metadata
for alias, standard_key in pairs(metadata.aliases) do
if standard_key == key then
local alias_key = alias .. suffix
if args[alias_key] and args[alias_key] ~= "" then
val = args[alias_key]
break
end
end
end
end
if val and val ~= "" then return mw.text.trim(val) end
return nil
end
-- Helper: Apply formatting styles safely
local function apply_style(text, style)
if not text then return "" end
if style == "italic" then return "''" .. text .. "''"
elseif style == "quotes" then return "„" .. text .. "“" end
return text
end
-- Helper: Small Caps HTML wrapper
local function small_caps(text)
if not text or text == "" then return "" end
return '<span style="font-variant: small-caps;">' .. text .. '</span>'
end
-- Helper: Parse semicolon-separated names and apply Small Caps
local function format_names(name_str)
if not name_str then return nil end
local names = {}
for name in string.gmatch(name_str, "([^;]+)") do
table.insert(names, small_caps(mw.text.trim(name)))
end
if #names == 0 then return nil end
local result_str = names[1]
if #names == 2 then
result_str = names[1] .. " & " .. names[2]
elseif #names > 2 then
result_str = ""
for j = 1, #names do
if j == 1 then result_str = names[j]
elseif j == #names then result_str = result_str .. ", & " .. names[j]
else result_str = result_str .. ", " .. names[j] end
end
end
return result_str
end
-- Helper: Extract a complete set of citation data for a given suffix
local function extract_data(args, suffix, rules)
local data = {}
-- Names (Authors and Editors)
local hof = get_arg(args, 'höfundur', suffix)
if hof then
data.authors = format_names(hof)
-- Ensure period placement plays nicely with the HTML span tag
if not string.match(data.authors, "[%.%?%!]$") and not string.match(data.authors, "</span>$") then
data.authors = data.authors .. "."
elseif string.match(data.authors, "</span>$") then
data.authors = data.authors .. "."
end
end
local rit = get_arg(args, 'ritstjóri', suffix)
if rit then data.editors = format_names(rit) end
-- Date / Year
data.year = get_arg(args, 'dags', suffix) or get_arg(args, 'ár', suffix)
if suffix == "" and not data.year then data.year = 'á.á.' end
-- Title
local tit = get_arg(args, 'titill', suffix)
if tit then
local thyd = get_arg(args, 'þýðing_titils', suffix)
local t_str = apply_style(tit, rules.title_style)
if thyd then t_str = t_str .. " [" .. thyd .. "]" end
data.title = t_str
end
-- Container (Journal, Website, etc.)
local tim = get_arg(args, 'tímarit', suffix)
if tim then data.container = apply_style(tim, rules.container_style) end
data.volume = get_arg(args, 'árgangur', suffix)
data.issue = get_arg(args, 'tölublað', suffix)
data.pages = get_arg(args, 'síður', suffix)
-- Publication Info
data.location = get_arg(args, 'útgáfustaður', suffix)
data.publisher = get_arg(args, 'útgefandi', suffix)
-- URL
data.url = get_arg(args, 'vefslóð', suffix)
data.access = get_arg(args, 'sótt', suffix)
-- Verify if this block actually contains data
data.is_empty = not (data.authors or data.year or data.title or data.container or data.publisher or data.url)
return data
end
function p.tilvisun(frame)
local args = frame:getParent().args
if not args['höfundur'] and not args['titill'] and not args['author'] then
args = frame.args
end
local tegund = get_arg(args, 'tegund', "") or "vef"
local rules = metadata.format_rules[tegund] or metadata.format_rules["vef"]
-- Extract Data for Part 1 (no suffix) and Part 2 ("-2" suffix)
local d1 = extract_data(args, "", rules)
local d2 = extract_data(args, "-2", rules)
local result = ""
-- BUILD PART 1
if not d1.is_empty then
if d1.authors then result = result .. d1.authors .. " " end
if d1.year then result = result .. "(" .. d1.year .. "). " end
if d1.title then
local t = d1.title
if not string.match(t, "[%.%?%!%]$]$") and not string.match(t, "“$") then t = t .. "."
elseif string.match(t, "%]$") or string.match(t, "“$") then t = t .. "." end
result = result .. t .. " "
end
if d1.container or d1.editors then
if d1.editors then result = result .. "Í " .. d1.editors .. " (ritstj.), " end
if d1.container then
result = result .. d1.container
if d1.volume then result = result .. ", ''" .. d1.volume .. "''" end
if d1.issue then result = result .. "(" .. d1.issue .. ")" end
if d1.pages then result = result .. ", " .. d1.pages end
result = result .. ". "
else
if d1.pages then result = mw.text.trim(result) .. ", " .. d1.pages .. ". " end
end
end
local pub = ""
if d1.location then pub = d1.location end
if d1.publisher then
if pub ~= "" then pub = pub .. ": " .. d1.publisher
else pub = d1.publisher end
end
if pub ~= "" then result = result .. pub .. ". " end
if d1.url then
if d1.access then result = result .. "Sótt " .. d1.access .. ", af [" .. d1.url .. " " .. d1.url .. "] "
else result = result .. "[" .. d1.url .. " " .. d1.url .. "] " end
end
end
result = mw.text.trim(result)
-- BUILD PART 2 (Translations, Reprints, Quotes)
if not d2.is_empty then
-- Tenging explicitly avoids the suffix loop
local p2 = get_arg(args, 'tenging', "") or "Endurprentað í"
-- If Part 2 has its own unique authors, format it as a standalone linked citation
if d2.authors then
p2 = p2 .. " " .. d2.authors
if d2.year then p2 = p2 .. " (" .. d2.year .. ")." end
p2 = p2 .. " "
end
if d2.title then
p2 = mw.text.trim(p2) .. " " .. d2.title
end
if d2.editors or d2.container then
local needs_i = false
if d2.title then needs_i = true
elseif not string.match(p2, "í$") then needs_i = true end
if needs_i then
if d2.title then p2 = p2 .. ", í " else p2 = p2 .. " í " end
elseif d2.title then p2 = p2 .. ", " else p2 = p2 .. " " end
p2 = string.gsub(p2, " +", " ")
if d2.editors then p2 = mw.text.trim(p2) .. " " .. d2.editors .. " (ritstj.), " end
if d2.container then
p2 = mw.text.trim(p2) .. " " .. d2.container
if d2.volume then p2 = p2 .. ", ''" .. d2.volume .. "''" end
if d2.issue then p2 = p2 .. "(" .. d2.issue .. ")" end
if d2.pages then p2 = p2 .. ", " .. d2.pages end
else
if d2.pages then
p2 = mw.text.trim(p2)
if string.match(p2, ",$") then p2 = p2 .. " " .. d2.pages
else p2 = p2 .. ", " .. d2.pages end
end
end
else
if d2.pages then
p2 = mw.text.trim(p2)
if string.match(p2, "[,%.]$") then p2 = string.gsub(p2, "[,%.]$", "") .. ", " .. d2.pages
else p2 = p2 .. ", " .. d2.pages end
end
end
p2 = string.gsub(mw.text.trim(p2), "[,%.]$", "")
if p2 ~= "" then result = result .. " " .. p2 .. ". " end
local pub2 = ""
if d2.location then pub2 = d2.location end
if d2.publisher then
if pub2 ~= "" then pub2 = pub2 .. ": " .. d2.publisher
else pub2 = d2.publisher end
end
if not d2.authors and d2.year then
if pub2 ~= "" then pub2 = pub2 .. ", " .. d2.year
else pub2 = d2.year end
end
if pub2 ~= "" then result = result .. pub2 .. ". " end
if d2.url then
if d2.access then result = result .. "Sótt " .. d2.access .. ", af [" .. d2.url .. " " .. d2.url .. "]"
else result = result .. "[" .. d2.url .. " " .. d2.url .. "]" end
end
end
return mw.text.trim(result)
end
return p
m9sp3fflmdv5remdush8c8c2g70ve1v
392438
392437
2026-08-30T00:32:16Z
Ow! That Hurts!
8952
392438
Scribunto
text/plain
local p = {}
local metadata = mw.loadData('Module:tilvísun/data')
-- Helper: Fetch argument with optional suffix (like "-2"), checking aliases
local function get_arg(args, key, suffix)
suffix = suffix or ""
local target_key = key .. suffix
local val = args[target_key]
if not val or val == "" then
-- Check aliases in metadata
for alias, standard_key in pairs(metadata.aliases) do
if standard_key == key then
local alias_key = alias .. suffix
if args[alias_key] and args[alias_key] ~= "" then
val = args[alias_key]
break
end
end
end
end
if val and val ~= "" then return mw.text.trim(val) end
return nil
end
-- Helper: Apply formatting styles safely
local function apply_style(text, style)
if not text then return "" end
if style == "italic" then return "''" .. text .. "''"
elseif style == "quotes" then return "„" .. text .. "“" end
return text
end
-- Helper: Small Caps HTML wrapper
local function small_caps(text)
if not text or text == "" then return "" end
return '<span style="font-variant: small-caps;">' .. text .. '</span>'
end
-- Helper: Parse semicolon-separated names and apply Small Caps
local function format_names(name_str)
if not name_str then return nil end
local names = {}
for name in string.gmatch(name_str, "([^;]+)") do
table.insert(names, small_caps(mw.text.trim(name)))
end
if #names == 0 then return nil end
local result_str = names[1]
if #names == 2 then
result_str = names[1] .. " & " .. names[2]
elseif #names > 2 then
result_str = ""
for j = 1, #names do
if j == 1 then result_str = names[j]
elseif j == #names then result_str = result_str .. ", & " .. names[j]
else result_str = result_str .. ", " .. names[j] end
end
end
return result_str
end
-- Helper: Extract a complete set of citation data for a given suffix
local function extract_data(args, suffix, rules)
local data = {}
-- Names (Authors and Editors)
local hof = get_arg(args, 'höfundur', suffix)
if hof then
data.authors = format_names(hof)
-- Ensure period placement plays nicely with the HTML span tag
if not string.match(data.authors, "[%.%?%!]$") and not string.match(data.authors, "</span>$") then
data.authors = data.authors .. "."
elseif string.match(data.authors, "</span>$") then
data.authors = data.authors .. "."
end
end
local rit = get_arg(args, 'ritstjóri', suffix)
if rit then data.editors = format_names(rit) end
-- Date / Year
data.year = get_arg(args, 'dags', suffix) or get_arg(args, 'ár', suffix)
if suffix == "" and not data.year then data.year = 'á.á.' end
-- Title
local tit = get_arg(args, 'titill', suffix)
if tit then
local thyd = get_arg(args, 'þýðing_titils', suffix)
local t_str = apply_style(tit, rules.title_style)
if thyd then t_str = t_str .. " [" .. thyd .. "]" end
data.title = t_str
end
-- Container (Journal, Website, etc.)
local tim = get_arg(args, 'tímarit', suffix)
if tim then data.container = apply_style(tim, rules.container_style) end
data.volume = get_arg(args, 'árgangur', suffix)
data.issue = get_arg(args, 'tölublað', suffix)
data.pages = get_arg(args, 'síður', suffix)
-- Publication Info
data.location = get_arg(args, 'útgáfustaður', suffix)
data.publisher = get_arg(args, 'útgefandi', suffix)
-- URL
data.url = get_arg(args, 'vefslóð', suffix)
data.access = get_arg(args, 'sótt', suffix)
-- Verify if this block actually contains data
data.is_empty = not (data.authors or data.year or data.title or data.container or data.publisher or data.url)
return data
end
function p.tilvisun(frame)
local args = frame:getParent().args
if not args['höfundur'] and not args['titill'] and not args['author'] then
args = frame.args
end
local tegund = get_arg(args, 'tegund', "") or "vef"
local rules = metadata.format_rules[tegund] or metadata.format_rules["vef"]
-- Extract Data for Part 1 (no suffix) and Part 2 ("-2" suffix)
local d1 = extract_data(args, "", rules)
local d2 = extract_data(args, "-2", rules)
local result = ""
-- BUILD PART 1
if not d1.is_empty then
if d1.authors then result = result .. d1.authors .. " " end
if d1.year then result = result .. "(" .. d1.year .. "). " end
if d1.title then
local t = d1.title
if not string.match(t, "[%.%?%!%]$]$") and not string.match(t, "“$") then t = t .. "."
elseif string.match(t, "%]$") or string.match(t, "“$") then t = t .. "." end
result = result .. t .. " "
end
if d1.container or d1.editors then
if d1.editors then result = result .. "Í " .. d1.editors .. " (ritstj.), " end
if d1.container then
result = result .. d1.container
if d1.volume then result = result .. ", ''" .. d1.volume .. "''" end
if d1.issue then result = result .. "(" .. d1.issue .. ")" end
if d1.pages then result = result .. ", " .. d1.pages end
result = result .. ". "
else
if d1.pages then result = mw.text.trim(result) .. ", " .. d1.pages .. ". " end
end
end
local pub = ""
if d1.location then pub = d1.location end
if d1.publisher then
if pub ~= "" then pub = pub .. ": " .. d1.publisher
else pub = d1.publisher end
end
if pub ~= "" then result = result .. pub .. ". " end
if d1.url then
if d1.access then result = result .. "Sótt " .. d1.access .. ", af [" .. d1.url .. " " .. d1.url .. "] "
else result = result .. "[" .. d1.url .. " " .. d1.url .. "] " end
end
end
result = mw.text.trim(result)
-- BUILD PART 2 (Translations, Reprints, Quotes)
if not d2.is_empty then
-- Tenging explicitly avoids the suffix loop
local p2 = get_arg(args, 'tenging', "") or "Endurprentað í"
-- If Part 2 has its own unique authors, format it as a standalone linked citation
if d2.authors then
p2 = p2 .. " " .. d2.authors
if d2.year then p2 = p2 .. " (" .. d2.year .. ")." end
p2 = p2 .. " "
end
if d2.title then
p2 = mw.text.trim(p2) .. " " .. d2.title
end
if d2.editors or d2.container then
local needs_i = false
if d2.title then needs_i = true
elseif not string.match(p2, "í$") then needs_i = true end
if needs_i then
if d2.title then p2 = p2 .. ", í " else p2 = p2 .. " í " end
elseif d2.title then p2 = p2 .. ", " else p2 = p2 .. " " end
p2 = string.gsub(p2, " +", " ")
if d2.editors then p2 = mw.text.trim(p2) .. " " .. d2.editors .. " (ritstj.), " end
if d2.container then
p2 = mw.text.trim(p2) .. " " .. d2.container
if d2.volume then p2 = p2 .. ", ''" .. d2.volume .. "''" end
if d2.issue then p2 = p2 .. "(" .. d2.issue .. ")" end
if d2.pages then p2 = p2 .. ", " .. d2.pages end
else
if d2.pages then
p2 = mw.text.trim(p2)
if string.match(p2, ",$") then p2 = p2 .. " " .. d2.pages
else p2 = p2 .. ", " .. d2.pages end
end
end
else
if d2.pages then
p2 = mw.text.trim(p2)
if string.match(p2, "[,%.]$") then p2 = string.gsub(p2, "[,%.]$", "") .. ", " .. d2.pages
else p2 = p2 .. ", " .. d2.pages end
end
end
p2 = string.gsub(mw.text.trim(p2), "[,%.]$", "")
if p2 ~= "" then result = result .. " " .. p2 .. ". " end
local pub2 = ""
if d2.location then pub2 = d2.location end
if d2.publisher then
if pub2 ~= "" then pub2 = pub2 .. ": " .. d2.publisher
else pub2 = d2.publisher end
end
if not d2.authors and d2.year then
if pub2 ~= "" then pub2 = pub2 .. ", " .. d2.year
else pub2 = d2.year end
end
if pub2 ~= "" then result = result .. pub2 .. ". " end
if d2.url then
if d2.access then result = result .. "Sótt " .. d2.access .. ", af [" .. d2.url .. " " .. d2.url .. "]"
else result = result .. "[" .. d2.url .. " " .. d2.url .. "]" end
end
end
return mw.text.trim(result)
end
return p
qlj3kycr73ak48baa8x7mqdvydz3e53
392439
392438
2026-08-30T00:45:13Z
Ow! That Hurts!
8952
392439
Scribunto
text/plain
local p = {}
local metadata = mw.loadData('Module:tilvísun/data')
-- Helper: Fetch argument with optional suffix (like "-2"), checking aliases
local function get_arg(args, key, suffix)
suffix = suffix or ""
local target_key = key .. suffix
local val = args[target_key]
if not val or val == "" then
-- Check aliases in metadata
for alias, standard_key in pairs(metadata.aliases) do
if standard_key == key then
local alias_key = alias .. suffix
if args[alias_key] and args[alias_key] ~= "" then
val = args[alias_key]
break
end
end
end
end
if val and val ~= "" then return mw.text.trim(val) end
return nil
end
-- Helper: Parse inline translations like <þ:Dagarnar>
local function parse_translation(text)
if not text then return nil, nil end
local trans = string.match(text, "<þ:(.-)>")
if trans then
-- Remove the tag from the base text
local base = string.gsub(text, "%s*<þ:.->", "")
return mw.text.trim(base), mw.text.trim(trans)
end
return text, nil
end
-- Helper: Apply formatting styles safely
local function apply_style(text, style)
if not text then return "" end
if style == "italic" then return "''" .. text .. "''"
elseif style == "quotes" then return "„" .. text .. "“" end
return text
end
-- Helper: Small Caps HTML wrapper
local function small_caps(text)
if not text or text == "" then return "" end
return '<span style="font-variant: small-caps;">' .. text .. '</span>'
end
-- Helper: Parse semicolon-separated names, apply Small Caps, and use "og"
local function format_names(name_str)
if not name_str then return nil end
local names = {}
for name in string.gmatch(name_str, "([^;]+)") do
table.insert(names, small_caps(mw.text.trim(name)))
end
if #names == 0 then return nil end
local result_str = names[1]
if #names == 2 then
result_str = names[1] .. " og " .. names[2]
elseif #names > 2 then
result_str = ""
for j = 1, #names do
if j == 1 then result_str = names[j]
elseif j == #names then result_str = result_str .. ", og " .. names[j]
else result_str = result_str .. ", " .. names[j] end
end
end
return result_str
end
-- Helper: Extract a complete set of citation data for a given suffix
local function extract_data(args, suffix, rules)
local data = {}
-- Names (Authors and Editors)
local hof = get_arg(args, 'höfundur', suffix)
if hof then
data.authors = format_names(hof)
if not string.match(data.authors, "[%.%?%!]$") and not string.match(data.authors, "</span>$") then
data.authors = data.authors .. "."
elseif string.match(data.authors, "</span>$") then
data.authors = data.authors .. "."
end
end
local rit = get_arg(args, 'ritstjóri', suffix)
if rit then data.editors = format_names(rit) end
-- Date / Year
data.year = get_arg(args, 'dags', suffix) or get_arg(args, 'ár', suffix)
if suffix == "" and not data.year then data.year = 'á.á.' end
-- Title & Inline Translation Extraction
local tit_raw = get_arg(args, 'titill', suffix)
if tit_raw then
local base_tit, inline_thyd = parse_translation(tit_raw)
local thyd = get_arg(args, 'þýðing_titils', suffix) or inline_thyd
local t_str = apply_style(base_tit, rules.title_style)
if thyd then t_str = t_str .. " [" .. thyd .. "]" end
data.title = t_str
end
-- Container & Inline Translation Extraction
local tim_raw = get_arg(args, 'tímarit', suffix)
if tim_raw then
local base_tim, inline_thyd = parse_translation(tim_raw)
local c_str = apply_style(base_tim, rules.container_style)
if inline_thyd then c_str = c_str .. " [" .. inline_thyd .. "]" end
data.container = c_str
end
data.volume = get_arg(args, 'árgangur', suffix)
data.issue = get_arg(args, 'tölublað', suffix)
-- Pages (Now explicitly aliases síða locally)
data.pages = get_arg(args, 'síður', suffix) or get_arg(args, 'síða', suffix)
-- Publication Info
data.location = get_arg(args, 'útgáfustaður', suffix)
data.publisher = get_arg(args, 'útgefandi', suffix)
-- URL
data.url = get_arg(args, 'vefslóð', suffix)
data.access = get_arg(args, 'sótt', suffix)
-- Verify if this block actually contains data
data.is_empty = not (data.authors or data.year or data.title or data.container or data.publisher or data.url)
return data
end
function p.tilvisun(frame)
local args = frame:getParent().args
if not args['höfundur'] and not args['titill'] and not args['author'] then
args = frame.args
end
local tegund = get_arg(args, 'tegund', "") or "vef"
local rules = metadata.format_rules[tegund] or metadata.format_rules["vef"]
local d1 = extract_data(args, "", rules)
local d2 = extract_data(args, "-2", rules)
local result = ""
-- BUILD PART 1
if not d1.is_empty then
if d1.authors then result = result .. d1.authors .. " " end
if d1.year then result = result .. "(" .. d1.year .. "). " end
if d1.title then
local t = d1.title
if not string.match(t, "[%.%?%!%]$]$") and not string.match(t, "“$") then t = t .. "."
elseif string.match(t, "%]$") or string.match(t, "“$") then t = t .. "." end
result = result .. t .. " "
end
if d1.container or d1.editors then
if d1.editors then result = result .. "Í " .. d1.editors .. " (ritstj.), " end
if d1.container then
result = result .. d1.container
if d1.volume then result = result .. ", ''" .. d1.volume .. "''" end
if d1.issue then result = result .. "(" .. d1.issue .. ")" end
if d1.pages then result = result .. ", " .. d1.pages end
result = result .. ". "
else
if d1.pages then result = mw.text.trim(result) .. ", " .. d1.pages .. ". " end
end
end
local pub = ""
if d1.location then pub = d1.location end
if d1.publisher then
if pub ~= "" then pub = pub .. ": " .. d1.publisher
else pub = d1.publisher end
end
if pub ~= "" then result = result .. pub .. ". " end
-- Fix for missing container/editors but pages still passed
if d1.pages and not d1.container and not d1.editors then
result = string.gsub(mw.text.trim(result), "%.$", "") .. ", " .. d1.pages .. ". "
end
-- Bare URL Logic
if d1.url then
if d1.access then result = mw.text.trim(result) .. " Sótt " .. d1.access .. ", af " .. d1.url .. " "
else result = mw.text.trim(result) .. " " .. d1.url .. " " end
end
end
result = mw.text.trim(result)
-- BUILD PART 2
if not d2.is_empty then
-- Convert Part 1 trailing period to a semicolon
if string.match(result, "%.$") then
result = string.gsub(result, "%.$", "")
end
result = result .. "; "
local p2 = get_arg(args, 'tenging', "") or "endurprentað í"
if d2.authors then
p2 = p2 .. " " .. d2.authors
if d2.year then p2 = p2 .. " (" .. d2.year .. ")." end
p2 = p2 .. " "
end
if d2.title then
p2 = mw.text.trim(p2) .. " " .. d2.title
end
if d2.editors or d2.container then
local needs_i = false
if d2.title then needs_i = true
elseif not string.match(p2, "í$") then needs_i = true end
if needs_i then
if d2.title then p2 = p2 .. ", í " else p2 = p2 .. " í " end
elseif d2.title then p2 = p2 .. ", " else p2 = p2 .. " " end
p2 = string.gsub(p2, " +", " ")
if d2.editors then p2 = mw.text.trim(p2) .. " " .. d2.editors .. " (ritstj.), " end
if d2.container then
p2 = mw.text.trim(p2) .. " " .. d2.container
if d2.volume then p2 = p2 .. ", ''" .. d2.volume .. "''" end
if d2.issue then p2 = p2 .. "(" .. d2.issue .. ")" end
if d2.pages then p2 = p2 .. ", " .. d2.pages end
else
if d2.pages then
p2 = mw.text.trim(p2)
if string.match(p2, ",$") then p2 = p2 .. " " .. d2.pages
else p2 = p2 .. ", " .. d2.pages end
end
end
else
if d2.pages then
p2 = mw.text.trim(p2)
if string.match(p2, "[,%.]$") then p2 = string.gsub(p2, "[,%.]$", "") .. ", " .. d2.pages
else p2 = p2 .. ", " .. d2.pages end
end
end
p2 = string.gsub(mw.text.trim(p2), "[,%.]$", "")
if p2 ~= "" then result = result .. " " .. p2 .. ". " end
local pub2 = ""
if d2.location then pub2 = d2.location end
if d2.publisher then
if pub2 ~= "" then pub2 = pub2 .. ": " .. d2.publisher
else pub2 = d2.publisher end
end
if not d2.authors and d2.year then
if pub2 ~= "" then pub2 = pub2 .. ", " .. d2.year
else pub2 = d2.year end
end
if pub2 ~= "" then result = result .. pub2 .. ". " end
-- Bare URL logic for Part 2
if d2.url then
if d2.access then result = mw.text.trim(result) .. " Sótt " .. d2.access .. ", af " .. d2.url
else result = mw.text.trim(result) .. " " .. d2.url end
end
end
return mw.text.trim(result)
end
return p
5aeu0rq2syietkk2w0o78labqsae9wt
392441
392439
2026-08-30T06:14:40Z
Ow! That Hurts!
8952
392441
Scribunto
text/plain
local p = {}
local metadata = mw.loadData('Module:tilvísun/data')
-- Helper: Fetch argument, checking aliases natively, allowing for suffix (-2)
local function get_arg(args, key, suffix)
suffix = suffix or ""
local val = args[key .. suffix]
if not val or val == "" then
for alias, standard_key in pairs(metadata.aliases) do
if standard_key == key then
local alias_key = alias .. suffix
if args[alias_key] and args[alias_key] ~= "" then
val = args[alias_key]
break
end
end
end
end
if val and val ~= "" then return mw.text.trim(val) end
return nil
end
-- Helper: Inline translations like <þ:Dagarnar>
local function parse_translation(text)
if not text then return nil, nil end
local trans = string.match(text, "<þ:(.-)>")
if trans then
local base = string.gsub(text, "%s*<þ:.->", "")
return mw.text.trim(base), mw.text.trim(trans)
end
return text, nil
end
-- Helper: Safe styling
local function apply_style(text, style)
if not text then return "" end
if style == "italic" then return "''" .. text .. "''"
elseif style == "quotes" then return "„" .. text .. "“" end
return text
end
-- Helper: Small Caps HTML wrapper
local function small_caps(text)
if not text or text == "" then return "" end
return '<span style="font-variant: small-caps;">' .. text .. '</span>'
end
-- Helper: Format semicolon-separated names with "og"
local function format_names(name_str)
if not name_str then return nil end
local names = {}
for name in string.gmatch(name_str, "([^;]+)") do
table.insert(names, small_caps(mw.text.trim(name)))
end
if #names == 0 then return nil end
local result_str = names[1]
if #names == 2 then result_str = names[1] .. " og " .. names[2]
elseif #names > 2 then
result_str = ""
for j = 1, #names do
if j == 1 then result_str = names[j]
elseif j == #names then result_str = result_str .. ", og " .. names[j]
else result_str = result_str .. ", " .. names[j] end
end
end
return result_str
end
-- DATA EXTRACTOR: Grabs all 40+ parameters robustly
local function extract_data(args, suffix, rules)
local d = {}
-- Core & Roles
d.mainauthor = get_arg(args, 'aðalhöfundur', suffix) or get_arg(args, 'mainauthor', suffix)
d.authors = get_arg(args, 'höfundur', suffix) or get_arg(args, 'author', suffix)
if d.authors then d.authors = format_names(d.authors) end
d.editors = format_names(get_arg(args, 'ritstjóri', suffix) or get_arg(args, 'editor', suffix))
d.compiler = format_names(get_arg(args, 'samantekt', suffix) or get_arg(args, 'compiler', suffix))
d.quotee = format_names(get_arg(args, 'tilvitnaður', suffix) or get_arg(args, 'quotee', suffix))
d.translator = format_names(get_arg(args, 'þýðandi', suffix) or get_arg(args, 'translator', suffix))
-- Media Roles
d.director = format_names(get_arg(args, 'leikstjóri', suffix) or get_arg(args, 'director', suffix))
d.actor = format_names(get_arg(args, 'leikari', suffix) or get_arg(args, 'actor', suffix))
d.role = get_arg(args, 'hlutverk', suffix) or get_arg(args, 'role', suffix)
d.lyricist = format_names(get_arg(args, 'textahöfundur', suffix) or get_arg(args, 'lyricist', suffix))
d.composer = format_names(get_arg(args, 'tónskáld', suffix) or get_arg(args, 'composer', suffix))
d.artist = format_names(get_arg(args, 'flytjandi', suffix) or get_arg(args, 'artist', suffix))
d.feat = format_names(get_arg(args, 'með_framkomu', suffix) or get_arg(args, 'feat', suffix))
-- Date & Title Data
d.year = get_arg(args, 'dags', suffix) or get_arg(args, 'ár', suffix) or get_arg(args, 'year', suffix)
d.format = get_arg(args, 'snið', suffix) or get_arg(args, 'format', suffix)
d.genre = get_arg(args, 'tegund_efnis', suffix) or get_arg(args, 'genre', suffix)
d.medium = get_arg(args, 'miðill', suffix) or get_arg(args, 'medium', suffix)
local tit_raw = get_arg(args, 'titill', suffix) or get_arg(args, 'title', suffix)
if tit_raw then
local base_tit, inline_thyd = parse_translation(tit_raw)
local thyd = get_arg(args, 'þýðing_titils', suffix) or get_arg(args, 'trans-title', suffix) or inline_thyd
d.title = apply_style(base_tit, rules.title_style)
if thyd then d.title = d.title .. " [" .. thyd .. "]" end
end
-- Containers
local tim_raw = get_arg(args, 'tímarit', suffix) or get_arg(args, 'journal', suffix)
if tim_raw then
local base_tim, inline_thyd = parse_translation(tim_raw)
d.container = apply_style(base_tim, rules.container_style)
if inline_thyd then d.container = d.container .. " [" .. inline_thyd .. "]" end
end
d.album = get_arg(args, 'albúm', suffix) or get_arg(args, 'album', suffix)
d.series = get_arg(args, 'ritröð', suffix) or get_arg(args, 'series', suffix)
d.network = get_arg(args, 'sjónvarpsstöð', suffix) or get_arg(args, 'network', suffix)
d.mailing_list = get_arg(args, 'póstlisti', suffix) or get_arg(args, 'mailing list', suffix)
d.email = get_arg(args, 'tölvupóstur', suffix) or get_arg(args, 'email', suffix)
-- Locators & Positions
d.volume = get_arg(args, 'árgangur', suffix) or get_arg(args, 'volume', suffix)
d.issue = get_arg(args, 'tölublað', suffix) or get_arg(args, 'issue', suffix)
d.edition = get_arg(args, 'útgáfa', suffix) or get_arg(args, 'edition', suffix)
d.version = get_arg(args, 'útgáfa_hugbúnaðar', suffix) or get_arg(args, 'version', suffix)
d.system = get_arg(args, 'kerfi', suffix) or get_arg(args, 'system', suffix)
d.section = get_arg(args, 'hluti', suffix) or get_arg(args, 'section', suffix)
d.section_num = get_arg(args, 'hlutanúmer', suffix) or get_arg(args, 'section number', suffix)
d.chapter = get_arg(args, 'kafli', suffix) or get_arg(args, 'chapter', suffix)
d.chapter_num = get_arg(args, 'kaflanúmer', suffix) or get_arg(args, 'chapter number', suffix)
d.episode = get_arg(args, 'þáttur', suffix) or get_arg(args, 'episode', suffix)
d.scene = get_arg(args, 'atriði', suffix) or get_arg(args, 'scene', suffix)
d.level = get_arg(args, 'borð', suffix) or get_arg(args, 'level', suffix)
d.pages = get_arg(args, 'síður', suffix) or get_arg(args, 'síða', suffix) or get_arg(args, 'pages', suffix)
d.column = get_arg(args, 'dálkur', suffix) or get_arg(args, 'column', suffix)
d.line = get_arg(args, 'lína', suffix) or get_arg(args, 'line', suffix)
d.time = get_arg(args, 'tímasetning', suffix) or get_arg(args, 'time', suffix)
-- Publication Info & Parliament
d.location = get_arg(args, 'útgáfustaður', suffix) or get_arg(args, 'location', suffix)
d.publisher = get_arg(args, 'útgefandi', suffix) or get_arg(args, 'publisher', suffix)
d.report = get_arg(args, 'skýrsla', suffix) or get_arg(args, 'report', suffix)
d.legislative = get_arg(args, 'löggjafarþing', suffix) or get_arg(args, 'legislative body', suffix)
-- Identifiers
d.doi = get_arg(args, 'doi', suffix)
d.isbn = get_arg(args, 'isbn', suffix)
d.issn = get_arg(args, 'issn', suffix)
d.jstor = get_arg(args, 'jstor', suffix)
d.lccn = get_arg(args, 'lccn', suffix)
d.oclc = get_arg(args, 'oclc', suffix)
d.ol = get_arg(args, 'ol', suffix)
d.pmid = get_arg(args, 'pmid', suffix)
d.pmcid = get_arg(args, 'pmcid', suffix)
d.bibcode = get_arg(args, 'bibcode', suffix)
d.message_id = get_arg(args, 'skilaboðaauðkenni', suffix) or get_arg(args, 'message id', suffix)
d.id = get_arg(args, 'auðkenni', suffix) or get_arg(args, 'id', suffix)
d.url = get_arg(args, 'vefslóð', suffix) or get_arg(args, 'url', suffix)
d.access = get_arg(args, 'sótt', suffix) or get_arg(args, 'access-date', suffix)
d.note = get_arg(args, 'athugasemd', suffix) or get_arg(args, 'note', suffix)
-- Check if block exists
d.is_empty = not (d.authors or d.artist or d.year or d.title or d.container or d.publisher or d.url or d.album)
return d
end
-- BUILDER: Assembles the comma-separated block dynamically
local function build_citation(d, is_part2)
local parts = {}
if d.mainauthor then table.insert(parts, format_names(d.mainauthor)) end
if d.quotee then table.insert(parts, "tilvitnun í " .. d.quotee) end
if d.email then table.insert(parts, "tölvupóstur frá " .. d.email) end
-- Main Creators
local creator = d.authors or d.artist
if creator then
if d.year then table.insert(parts, creator .. " (" .. d.year .. ")")
else table.insert(parts, creator) end
elseif not is_part2 and d.year then
-- Default to (á.á.) only if it's the very first citation and no author/year given
table.insert(parts, "(" .. d.year .. ")")
elseif is_part2 and d.year then
table.insert(parts, "(" .. d.year .. ")")
end
-- Title & Modifiers
if d.title then
local t = d.title
local mods = {}
if d.format then table.insert(mods, d.format) end
if d.medium then table.insert(mods, d.medium) end
if d.genre then table.insert(mods, d.genre) end
if #mods > 0 then t = t .. " [" .. table.concat(mods, ", ") .. "]" end
table.insert(parts, t)
end
-- Translators & Specialized Roles
if d.translator then table.insert(parts, "þýtt af " .. d.translator) end
if d.director then table.insert(parts, "leikstýrt af " .. d.director) end
if d.composer then table.insert(parts, "tónlist eftir " .. d.composer) end
if d.lyricist then table.insert(parts, "texti eftir " .. d.lyricist) end
if d.actor then
local act = "leikið af " .. d.actor
if d.role then act = act .. " í hlutverki " .. d.role end
table.insert(parts, act)
end
if d.feat then table.insert(parts, "með framkomu frá " .. d.feat) end
if d.compiler then table.insert(parts, "tekið saman af " .. d.compiler) end
-- Containers
local cont = ""
if d.editors or d.container or d.album or d.mailing_list then
cont = "í "
if d.editors then cont = cont .. d.editors .. " (ritstj.), " end
if d.container then cont = cont .. d.container
elseif d.album then cont = cont .. apply_style(d.album, "italic")
elseif d.mailing_list then cont = cont .. "póstlistanum " .. d.mailing_list end
end
if cont ~= "" and cont ~= "í " then table.insert(parts, mw.text.trim(cont, ", ")) end
-- Sub-Containers
if d.series then table.insert(parts, "ritröð: " .. d.series) end
if d.network then table.insert(parts, d.network) end
if d.legislative then table.insert(parts, d.legislative) end
if d.report then table.insert(parts, d.report)
elseif d.legislative and not d.report then table.insert(parts, "þingræða") end
-- Broad Locators
if d.volume then table.insert(parts, "árg. " .. d.volume) end
if d.issue then table.insert(parts, "tbl. " .. d.issue) end
if d.edition then table.insert(parts, d.edition .. " útg.") end
if d.version then table.insert(parts, "útgáfa " .. d.version) end
if d.system then table.insert(parts, d.system) end
if d.chapter then table.insert(parts, "kafli: " .. d.chapter)
elseif d.chapter_num then table.insert(parts, d.chapter_num .. ". kafli") end
if d.section then table.insert(parts, "hluti: " .. d.section)
elseif d.section_num then table.insert(parts, d.section_num .. ". hluti") end
if d.episode then table.insert(parts, "þáttur: " .. d.episode) end
if d.scene then table.insert(parts, "atriði: " .. d.scene) end
if d.level then table.insert(parts, "borð: " .. d.level) end
-- Publication Info
local pub = ""
if d.location then pub = d.location end
if d.publisher then
if pub ~= "" then pub = pub .. ": " .. d.publisher
else pub = d.publisher end
end
if pub ~= "" then table.insert(parts, pub) end
-- Precise Locators
if d.pages then table.insert(parts, "s. " .. d.pages) end
if d.column then table.insert(parts, "dálkur " .. d.column) end
if d.line then table.insert(parts, "lína " .. d.line) end
if d.time then table.insert(parts, d.time) end
-- Identifiers
if d.doi then table.insert(parts, "DOI: " .. d.doi) end
if d.isbn then table.insert(parts, "ISBN " .. d.isbn) end
if d.issn then table.insert(parts, "ISSN " .. d.issn) end
if d.jstor then table.insert(parts, "JSTOR " .. d.jstor) end
if d.lccn then table.insert(parts, "LCCN " .. d.lccn) end
if d.oclc then table.insert(parts, "OCLC " .. d.oclc) end
if d.ol then table.insert(parts, "OL " .. d.ol) end
if d.pmid then table.insert(parts, "PMID " .. d.pmid) end
if d.pmcid then table.insert(parts, "PMCID " .. d.pmcid) end
if d.bibcode then table.insert(parts, "Bibcode: " .. d.bibcode) end
if d.message_id then table.insert(parts, "Message-ID: " .. d.message_id) end
if d.id then table.insert(parts, d.id) end
-- Online Source
if d.url then
if d.access then table.insert(parts, "sótt " .. d.access .. " af " .. d.url)
else table.insert(parts, d.url) end
end
-- Miscellaneous Note
if d.note then table.insert(parts, "(" .. d.note .. ")") end
return table.concat(parts, ", ")
end
function p.tilvisun(frame)
local args = frame:getParent().args
if not args['höfundur'] and not args['titill'] and not args['author'] then
args = frame.args
end
local tegund = get_arg(args, 'tegund', "") or "vef"
local rules = metadata.format_rules[tegund] or metadata.format_rules["vef"]
local d1 = extract_data(args, "", rules)
local d2 = extract_data(args, "-2", rules)
local final_str = ""
-- Compile Part 1
if not d1.is_empty then
final_str = build_citation(d1, false)
end
-- Compile Part 2 and connect with semicolon
if not d2.is_empty then
local p2_str = build_citation(d2, true)
local tenging = get_arg(args, 'tenging', "") or "endurprentað í"
if final_str ~= "" then
final_str = final_str .. "; " .. tenging .. " " .. p2_str
else
final_str = p2_str
end
end
return final_str
end
return p
gc42am7jsw6eqte8d1was6mvyfk4m75
392442
392441
2026-08-30T06:22:52Z
Ow! That Hurts!
8952
392442
Scribunto
text/plain
local p = {}
local metadata = mw.loadData('Module:tilvísun/data')
-- Helper: Fetch argument, checking aliases natively, allowing for suffix (-2)
local function get_arg(args, key, suffix)
suffix = suffix or ""
local val = args[key .. suffix]
if not val or val == "" then
for alias, standard_key in pairs(metadata.aliases) do
if standard_key == key then
local alias_key = alias .. suffix
if args[alias_key] and args[alias_key] ~= "" then
val = args[alias_key]
break
end
end
end
end
if val and val ~= "" then return mw.text.trim(val) end
return nil
end
-- Helper: Inline translations like <þ:Dagarnar>
local function parse_translation(text)
if not text then return nil, nil end
local trans = string.match(text, "<þ:(.-)>")
if trans then
local base = string.gsub(text, "%s*<þ:.->", "")
return mw.text.trim(base), mw.text.trim(trans)
end
return text, nil
end
-- Helper: Safe styling
local function apply_style(text, style)
if not text then return "" end
if style == "italic" then return "''" .. text .. "''"
elseif style == "quotes" then return "„" .. text .. "“" end
return text
end
-- Helper: Small Caps HTML wrapper
local function small_caps(text)
if not text or text == "" then return "" end
return '<span style="font-variant: small-caps;">' .. text .. '</span>'
end
-- Helper: Format semicolon-separated names with "og"
local function format_names(name_str)
if not name_str then return nil end
local names = {}
for name in string.gmatch(name_str, "([^;]+)") do
table.insert(names, small_caps(mw.text.trim(name)))
end
if #names == 0 then return nil end
local result_str = names[1]
if #names == 2 then result_str = names[1] .. " og " .. names[2]
elseif #names > 2 then
result_str = ""
for j = 1, #names do
if j == 1 then result_str = names[j]
elseif j == #names then result_str = result_str .. ", og " .. names[j]
else result_str = result_str .. ", " .. names[j] end
end
end
return result_str
end
-- DATA EXTRACTOR
local function extract_data(args, suffix)
local d = {}
-- Dynamically load the rules specifically for this suffix
local raw_tegund = get_arg(args, 'tegund', suffix) or get_arg(args, 'type', suffix) or "vef"
raw_tegund = mw.ustring.lower(raw_tegund)
-- Map natural Icelandic spelling to data keys
if raw_tegund == "bók" then raw_tegund = "bok" end
if raw_tegund == "tímarit" then raw_tegund = "timarit" end
local rules = metadata.format_rules[raw_tegund] or metadata.format_rules["vef"] or { title_style = "italic", container_style = "plain" }
-- Core & Roles
d.mainauthor = get_arg(args, 'aðalhöfundur', suffix) or get_arg(args, 'mainauthor', suffix)
d.authors = get_arg(args, 'höfundur', suffix) or get_arg(args, 'author', suffix)
if d.authors then d.authors = format_names(d.authors) end
d.editors = format_names(get_arg(args, 'ritstjóri', suffix) or get_arg(args, 'editor', suffix))
d.compiler = format_names(get_arg(args, 'samantekt', suffix) or get_arg(args, 'compiler', suffix))
d.quotee = format_names(get_arg(args, 'tilvitnaður', suffix) or get_arg(args, 'quotee', suffix))
d.translator = format_names(get_arg(args, 'þýðandi', suffix) or get_arg(args, 'translator', suffix))
-- Media Roles
d.director = format_names(get_arg(args, 'leikstjóri', suffix) or get_arg(args, 'director', suffix))
d.actor = format_names(get_arg(args, 'leikari', suffix) or get_arg(args, 'actor', suffix))
d.role = get_arg(args, 'hlutverk', suffix) or get_arg(args, 'role', suffix)
d.lyricist = format_names(get_arg(args, 'textahöfundur', suffix) or get_arg(args, 'lyricist', suffix))
d.composer = format_names(get_arg(args, 'tónskáld', suffix) or get_arg(args, 'composer', suffix))
d.artist = format_names(get_arg(args, 'flytjandi', suffix) or get_arg(args, 'artist', suffix))
d.feat = format_names(get_arg(args, 'með_framkomu', suffix) or get_arg(args, 'feat', suffix))
-- Date & Title Data
d.year = get_arg(args, 'dags', suffix) or get_arg(args, 'ár', suffix) or get_arg(args, 'year', suffix)
d.format = get_arg(args, 'snið', suffix) or get_arg(args, 'format', suffix)
d.genre = get_arg(args, 'tegund_efnis', suffix) or get_arg(args, 'genre', suffix)
d.medium = get_arg(args, 'miðill', suffix) or get_arg(args, 'medium', suffix)
local tit_raw = get_arg(args, 'titill', suffix) or get_arg(args, 'title', suffix)
if tit_raw then
local base_tit, inline_thyd = parse_translation(tit_raw)
local thyd = get_arg(args, 'þýðing_titils', suffix) or get_arg(args, 'trans-title', suffix) or inline_thyd
d.title = apply_style(base_tit, rules.title_style)
if thyd then d.title = d.title .. " [" .. thyd .. "]" end
end
-- Containers
local tim_raw = get_arg(args, 'tímarit', suffix) or get_arg(args, 'journal', suffix)
if tim_raw then
local base_tim, inline_thyd = parse_translation(tim_raw)
d.container = apply_style(base_tim, rules.container_style)
if inline_thyd then d.container = d.container .. " [" .. inline_thyd .. "]" end
end
d.album = get_arg(args, 'albúm', suffix) or get_arg(args, 'album', suffix)
d.series = get_arg(args, 'ritröð', suffix) or get_arg(args, 'series', suffix)
d.network = get_arg(args, 'sjónvarpsstöð', suffix) or get_arg(args, 'network', suffix)
d.mailing_list = get_arg(args, 'póstlisti', suffix) or get_arg(args, 'mailing list', suffix)
d.email = get_arg(args, 'tölvupóstur', suffix) or get_arg(args, 'email', suffix)
-- Locators & Positions
d.volume = get_arg(args, 'árgangur', suffix) or get_arg(args, 'volume', suffix)
d.issue = get_arg(args, 'tölublað', suffix) or get_arg(args, 'issue', suffix)
d.edition = get_arg(args, 'útgáfa', suffix) or get_arg(args, 'edition', suffix)
d.version = get_arg(args, 'útgáfa_hugbúnaðar', suffix) or get_arg(args, 'version', suffix)
d.system = get_arg(args, 'kerfi', suffix) or get_arg(args, 'system', suffix)
d.section = get_arg(args, 'hluti', suffix) or get_arg(args, 'section', suffix)
d.section_num = get_arg(args, 'hlutanúmer', suffix) or get_arg(args, 'section number', suffix)
d.chapter = get_arg(args, 'kafli', suffix) or get_arg(args, 'chapter', suffix)
d.chapter_num = get_arg(args, 'kaflanúmer', suffix) or get_arg(args, 'chapter number', suffix)
d.episode = get_arg(args, 'þáttur', suffix) or get_arg(args, 'episode', suffix)
d.scene = get_arg(args, 'atriði', suffix) or get_arg(args, 'scene', suffix)
d.level = get_arg(args, 'borð', suffix) or get_arg(args, 'level', suffix)
d.pages = get_arg(args, 'síður', suffix) or get_arg(args, 'síða', suffix) or get_arg(args, 'pages', suffix)
d.column = get_arg(args, 'dálkur', suffix) or get_arg(args, 'column', suffix)
d.line = get_arg(args, 'lína', suffix) or get_arg(args, 'line', suffix)
d.time = get_arg(args, 'tímasetning', suffix) or get_arg(args, 'time', suffix)
-- Publication Info & Parliament
d.location = get_arg(args, 'útgáfustaður', suffix) or get_arg(args, 'location', suffix)
d.publisher = get_arg(args, 'útgefandi', suffix) or get_arg(args, 'publisher', suffix)
d.report = get_arg(args, 'skýrsla', suffix) or get_arg(args, 'report', suffix)
d.legislative = get_arg(args, 'löggjafarþing', suffix) or get_arg(args, 'legislative body', suffix)
-- Identifiers
d.doi = get_arg(args, 'doi', suffix)
d.isbn = get_arg(args, 'isbn', suffix)
d.issn = get_arg(args, 'issn', suffix)
d.jstor = get_arg(args, 'jstor', suffix)
d.lccn = get_arg(args, 'lccn', suffix)
d.oclc = get_arg(args, 'oclc', suffix)
d.ol = get_arg(args, 'ol', suffix)
d.pmid = get_arg(args, 'pmid', suffix)
d.pmcid = get_arg(args, 'pmcid', suffix)
d.bibcode = get_arg(args, 'bibcode', suffix)
d.message_id = get_arg(args, 'skilaboðaauðkenni', suffix) or get_arg(args, 'message id', suffix)
d.id = get_arg(args, 'auðkenni', suffix) or get_arg(args, 'id', suffix)
d.url = get_arg(args, 'vefslóð', suffix) or get_arg(args, 'url', suffix)
d.access = get_arg(args, 'sótt', suffix) or get_arg(args, 'access-date', suffix)
d.note = get_arg(args, 'athugasemd', suffix) or get_arg(args, 'note', suffix)
d.is_empty = not (d.authors or d.artist or d.year or d.title or d.container or d.publisher or d.url or d.album)
return d
end
-- BUILDER
local function build_citation(d, is_part2)
local parts = {}
if d.mainauthor then table.insert(parts, format_names(d.mainauthor)) end
if d.quotee then table.insert(parts, "tilvitnun í " .. d.quotee) end
if d.email then table.insert(parts, "tölvupóstur frá " .. d.email) end
local creator = d.authors or d.artist
if creator then
if d.year then table.insert(parts, creator .. " (" .. d.year .. ")")
else table.insert(parts, creator) end
elseif not is_part2 and d.year then
table.insert(parts, "(" .. d.year .. ")")
elseif is_part2 and d.year then
table.insert(parts, "(" .. d.year .. ")")
end
if d.title then
local t = d.title
local mods = {}
if d.format then table.insert(mods, d.format) end
if d.medium then table.insert(mods, d.medium) end
if d.genre then table.insert(mods, d.genre) end
if #mods > 0 then t = t .. " [" .. table.concat(mods, ", ") .. "]" end
table.insert(parts, t)
end
if d.translator then table.insert(parts, "þýtt af " .. d.translator) end
if d.director then table.insert(parts, "leikstýrt af " .. d.director) end
if d.composer then table.insert(parts, "tónlist eftir " .. d.composer) end
if d.lyricist then table.insert(parts, "texti eftir " .. d.lyricist) end
if d.actor then
local act = "leikið af " .. d.actor
if d.role then act = act .. " í hlutverki " .. d.role end
table.insert(parts, act)
end
if d.feat then table.insert(parts, "með framkomu frá " .. d.feat) end
if d.compiler then table.insert(parts, "tekið saman af " .. d.compiler) end
local cont = ""
if d.editors or d.container or d.album or d.mailing_list then
cont = "í "
if d.editors then cont = cont .. d.editors .. " (ritstj.), " end
if d.container then cont = cont .. d.container
elseif d.album then cont = cont .. apply_style(d.album, "italic")
elseif d.mailing_list then cont = cont .. "póstlistanum " .. d.mailing_list end
end
if cont ~= "" and cont ~= "í " then table.insert(parts, mw.text.trim(cont, ", ")) end
if d.series then table.insert(parts, "ritröð: " .. d.series) end
if d.network then table.insert(parts, d.network) end
if d.legislative then table.insert(parts, d.legislative) end
if d.report then table.insert(parts, d.report)
elseif d.legislative and not d.report then table.insert(parts, "þingræða") end
if d.volume then table.insert(parts, "árg. " .. d.volume) end
if d.issue then table.insert(parts, "tbl. " .. d.issue) end
if d.edition then table.insert(parts, d.edition .. " útg.") end
if d.version then table.insert(parts, "útgáfa " .. d.version) end
if d.system then table.insert(parts, d.system) end
if d.chapter then table.insert(parts, "kafli: " .. d.chapter)
elseif d.chapter_num then table.insert(parts, d.chapter_num .. ". kafli") end
if d.section then table.insert(parts, "hluti: " .. d.section)
elseif d.section_num then table.insert(parts, d.section_num .. ". hluti") end
if d.episode then table.insert(parts, "þáttur: " .. d.episode) end
if d.scene then table.insert(parts, "atriði: " .. d.scene) end
if d.level then table.insert(parts, "borð: " .. d.level) end
local pub = ""
if d.location then pub = d.location end
if d.publisher then
if pub ~= "" then pub = pub .. ": " .. d.publisher
else pub = d.publisher end
end
if pub ~= "" then table.insert(parts, pub) end
if d.pages then table.insert(parts, "s. " .. d.pages) end
if d.column then table.insert(parts, "dálkur " .. d.column) end
if d.line then table.insert(parts, "lína " .. d.line) end
if d.time then table.insert(parts, d.time) end
if d.doi then table.insert(parts, "DOI: " .. d.doi) end
if d.isbn then table.insert(parts, "ISBN " .. d.isbn) end
if d.issn then table.insert(parts, "ISSN " .. d.issn) end
if d.jstor then table.insert(parts, "JSTOR " .. d.jstor) end
if d.lccn then table.insert(parts, "LCCN " .. d.lccn) end
if d.oclc then table.insert(parts, "OCLC " .. d.oclc) end
if d.ol then table.insert(parts, "OL " .. d.ol) end
if d.pmid then table.insert(parts, "PMID " .. d.pmid) end
if d.pmcid then table.insert(parts, "PMCID " .. d.pmcid) end
if d.bibcode then table.insert(parts, "Bibcode: " .. d.bibcode) end
if d.message_id then table.insert(parts, "Message-ID: " .. d.message_id) end
if d.id then table.insert(parts, d.id) end
if d.url then
if d.access then table.insert(parts, "sótt " .. d.access .. " af " .. d.url)
else table.insert(parts, d.url) end
end
if d.note then table.insert(parts, "(" .. d.note .. ")") end
return table.concat(parts, ", ")
end
function p.tilvisun(frame)
local args = frame:getParent().args
if not args['höfundur'] and not args['titill'] and not args['author'] then
args = frame.args
end
local d1 = extract_data(args, "")
local d2 = extract_data(args, "-2")
local final_str = ""
if not d1.is_empty then
final_str = build_citation(d1, false)
end
if not d2.is_empty then
local p2_str = build_citation(d2, true)
local tenging = get_arg(args, 'tenging', "") or "endurprentað í"
if final_str ~= "" then
final_str = final_str .. "; " .. tenging .. " " .. p2_str
else
final_str = p2_str
end
end
return final_str
end
return p
8zvo72vadnsa3a630hq23fuolvbgxf7
392444
392442
2026-08-30T08:52:31Z
Ow! That Hurts!
8952
392444
Scribunto
text/plain
local p = {}
local metadata = mw.loadData('Module:tilvísun/data')
-- Helper: Fetch argument, checking aliases natively, allowing for suffix (-2)
local function get_arg(args, key, suffix)
suffix = suffix or ""
local val = args[key .. suffix]
if not val or val == "" then
for alias, standard_key in pairs(metadata.aliases) do
if standard_key == key then
local alias_key = alias .. suffix
if args[alias_key] and args[alias_key] ~= "" then
val = args[alias_key]
break
end
end
end
end
if val and val ~= "" then return mw.text.trim(val) end
return nil
end
-- Helper: Inline translations like <þ:Dagarnar>
local function parse_translation(text)
if not text then return nil, nil end
local trans = string.match(text, "<þ:(.-)>")
if trans then
local base = string.gsub(text, "%s*<þ:.->", "")
return mw.text.trim(base), mw.text.trim(trans)
end
return text, nil
end
-- Helper: Safe styling
local function apply_style(text, style)
if not text then return "" end
if style == "italic" then return "''" .. text .. "''"
elseif style == "quotes" then return "„" .. text .. "“" end
return text
end
-- Helper: Small Caps HTML wrapper
local function small_caps(text)
if not text or text == "" then return "" end
return '<span style="font-variant: small-caps;">' .. text .. '</span>'
end
-- Helper: Format semicolon-separated names with "og"
local function format_names(name_str)
if not name_str then return nil end
local names = {}
for name in string.gmatch(name_str, "([^;]+)") do
table.insert(names, small_caps(mw.text.trim(name)))
end
if #names == 0 then return nil end
local result_str = names[1]
if #names == 2 then result_str = names[1] .. " og " .. names[2]
elseif #names > 2 then
result_str = ""
for j = 1, #names do
if j == 1 then result_str = names[j]
elseif j == #names then result_str = result_str .. ", og " .. names[j]
else result_str = result_str .. ", " .. names[j] end
end
end
return result_str
end
-- DATA EXTRACTOR
local function extract_data(args, suffix)
local d = {}
-- Dynamically load the rules specifically for this suffix
local raw_tegund = get_arg(args, 'tegund', suffix) or get_arg(args, 'type', suffix) or "vef"
raw_tegund = mw.ustring.lower(raw_tegund)
-- Map natural Icelandic spelling to data keys
if raw_tegund == "bók" then raw_tegund = "bok" end
if raw_tegund == "tímarit" then raw_tegund = "timarit" end
d.tegund = raw_tegund -- SAVE TEGUND FOR THE BUILDER
local rules = metadata.format_rules[raw_tegund] or metadata.format_rules["vef"] or { title_style = "italic", container_style = "plain" }
-- Core & Roles
d.mainauthor = get_arg(args, 'aðalhöfundur', suffix) or get_arg(args, 'mainauthor', suffix)
d.authors = get_arg(args, 'höfundur', suffix) or get_arg(args, 'author', suffix)
if d.authors then d.authors = format_names(d.authors) end
d.editors = format_names(get_arg(args, 'ritstjóri', suffix) or get_arg(args, 'editor', suffix))
d.compiler = format_names(get_arg(args, 'samantekt', suffix) or get_arg(args, 'compiler', suffix))
d.quotee = format_names(get_arg(args, 'tilvitnaður', suffix) or get_arg(args, 'quotee', suffix))
d.translator = format_names(get_arg(args, 'þýðandi', suffix) or get_arg(args, 'translator', suffix))
-- Media Roles
d.director = format_names(get_arg(args, 'leikstjóri', suffix) or get_arg(args, 'director', suffix))
d.actor = format_names(get_arg(args, 'leikari', suffix) or get_arg(args, 'actor', suffix))
d.role = get_arg(args, 'hlutverk', suffix) or get_arg(args, 'role', suffix)
d.lyricist = format_names(get_arg(args, 'textahöfundur', suffix) or get_arg(args, 'lyricist', suffix))
d.composer = format_names(get_arg(args, 'tónskáld', suffix) or get_arg(args, 'composer', suffix))
d.artist = format_names(get_arg(args, 'flytjandi', suffix) or get_arg(args, 'artist', suffix))
d.feat = format_names(get_arg(args, 'með_framkomu', suffix) or get_arg(args, 'feat', suffix))
-- Date & Title Data
d.year = get_arg(args, 'dags', suffix) or get_arg(args, 'ár', suffix) or get_arg(args, 'year', suffix)
d.format = get_arg(args, 'snið', suffix) or get_arg(args, 'format', suffix)
d.genre = get_arg(args, 'tegund_efnis', suffix) or get_arg(args, 'genre', suffix)
d.medium = get_arg(args, 'miðill', suffix) or get_arg(args, 'medium', suffix)
local tit_raw = get_arg(args, 'titill', suffix) or get_arg(args, 'title', suffix)
if tit_raw then
local base_tit, inline_thyd = parse_translation(tit_raw)
local thyd = get_arg(args, 'þýðing_titils', suffix) or get_arg(args, 'trans-title', suffix) or inline_thyd
d.title = apply_style(base_tit, rules.title_style)
if thyd then d.title = d.title .. " [" .. thyd .. "]" end
end
-- Containers
local tim_raw = get_arg(args, 'tímarit', suffix) or get_arg(args, 'journal', suffix)
if tim_raw then
local base_tim, inline_thyd = parse_translation(tim_raw)
d.container = apply_style(base_tim, rules.container_style)
if inline_thyd then d.container = d.container .. " [" .. inline_thyd .. "]" end
end
d.album = get_arg(args, 'albúm', suffix) or get_arg(args, 'album', suffix)
d.series = get_arg(args, 'ritröð', suffix) or get_arg(args, 'series', suffix)
d.network = get_arg(args, 'sjónvarpsstöð', suffix) or get_arg(args, 'network', suffix)
d.mailing_list = get_arg(args, 'póstlisti', suffix) or get_arg(args, 'mailing list', suffix)
d.email = get_arg(args, 'tölvupóstur', suffix) or get_arg(args, 'email', suffix)
-- Locators & Positions
d.volume = get_arg(args, 'árgangur', suffix) or get_arg(args, 'volume', suffix)
d.issue = get_arg(args, 'tölublað', suffix) or get_arg(args, 'issue', suffix)
d.edition = get_arg(args, 'útgáfa', suffix) or get_arg(args, 'edition', suffix)
d.version = get_arg(args, 'útgáfa_hugbúnaðar', suffix) or get_arg(args, 'version', suffix)
d.system = get_arg(args, 'kerfi', suffix) or get_arg(args, 'system', suffix)
d.section = get_arg(args, 'hluti', suffix) or get_arg(args, 'section', suffix)
d.section_num = get_arg(args, 'hlutanúmer', suffix) or get_arg(args, 'section number', suffix)
d.chapter = get_arg(args, 'kafli', suffix) or get_arg(args, 'chapter', suffix)
d.chapter_num = get_arg(args, 'kaflanúmer', suffix) or get_arg(args, 'chapter number', suffix)
d.episode = get_arg(args, 'þáttur', suffix) or get_arg(args, 'episode', suffix)
d.scene = get_arg(args, 'atriði', suffix) or get_arg(args, 'scene', suffix)
d.level = get_arg(args, 'borð', suffix) or get_arg(args, 'level', suffix)
d.pages = get_arg(args, 'síður', suffix) or get_arg(args, 'síða', suffix) or get_arg(args, 'pages', suffix)
d.column = get_arg(args, 'dálkur', suffix) or get_arg(args, 'column', suffix)
d.line = get_arg(args, 'lína', suffix) or get_arg(args, 'line', suffix)
d.time = get_arg(args, 'tímasetning', suffix) or get_arg(args, 'time', suffix)
-- Publication Info & Parliament
d.location = get_arg(args, 'útgáfustaður', suffix) or get_arg(args, 'location', suffix)
d.publisher = get_arg(args, 'útgefandi', suffix) or get_arg(args, 'publisher', suffix)
d.report = get_arg(args, 'skýrsla', suffix) or get_arg(args, 'report', suffix)
d.legislative = get_arg(args, 'löggjafarþing', suffix) or get_arg(args, 'legislative body', suffix)
-- Identifiers
d.doi = get_arg(args, 'doi', suffix)
d.isbn = get_arg(args, 'isbn', suffix)
d.issn = get_arg(args, 'issn', suffix)
d.jstor = get_arg(args, 'jstor', suffix)
d.lccn = get_arg(args, 'lccn', suffix)
d.oclc = get_arg(args, 'oclc', suffix)
d.ol = get_arg(args, 'ol', suffix)
d.pmid = get_arg(args, 'pmid', suffix)
d.pmcid = get_arg(args, 'pmcid', suffix)
d.bibcode = get_arg(args, 'bibcode', suffix)
d.message_id = get_arg(args, 'skilaboðaauðkenni', suffix) or get_arg(args, 'message id', suffix)
d.id = get_arg(args, 'auðkenni', suffix) or get_arg(args, 'id', suffix)
d.url = get_arg(args, 'vefslóð', suffix) or get_arg(args, 'url', suffix)
d.access = get_arg(args, 'sótt', suffix) or get_arg(args, 'access-date', suffix)
d.note = get_arg(args, 'athugasemd', suffix) or get_arg(args, 'note', suffix)
d.is_empty = not (d.authors or d.artist or d.year or d.title or d.container or d.publisher or d.url or d.album)
return d
end
-- BUILDER
local function build_citation(d, is_part2)
local b = {}
local tegund = d.tegund or "vef"
-- Helper to safely add a non-empty block to our APA segments
local function add(text)
if text and text ~= "" then
table.insert(b, mw.text.trim(text))
end
end
local auth = d.authors or (d.mainauthor and format_names(d.mainauthor))
-----------------------------------------------------
-- 1. BOOK (Bók)
-----------------------------------------------------
if tegund == "bok" or tegund == "bók" then
if auth then add(auth)
elseif d.editors then add(d.editors .. " (ritstj.)") end
if d.year then add("(" .. d.year .. ")") end
local t_parts = {}
if d.title then table.insert(t_parts, d.title) end
-- In APA authored books, editor goes IN parentheses after the title, not as "Í ritstj."
local p_mods = {}
if auth and d.editors then table.insert(p_mods, d.editors .. ", ritstj.") end
if d.translator then table.insert(p_mods, d.translator .. ", þýð.") end
if d.edition then table.insert(p_mods, d.edition .. " útg.") end
if d.volume then table.insert(p_mods, "árg. " .. d.volume) end
if d.pages then table.insert(p_mods, "s. " .. d.pages) end
if #p_mods > 0 then
if #t_parts > 0 then t_parts[1] = t_parts[1] .. " (" .. table.concat(p_mods, ", ") .. ")"
else table.insert(t_parts, "(" .. table.concat(p_mods, ", ") .. ")") end
end
if #t_parts > 0 then add(table.concat(t_parts, " ")) end
local pub = ""
if d.location and d.publisher then pub = d.location .. ": " .. d.publisher
elseif d.publisher then pub = d.publisher
elseif d.location then pub = d.location end
if pub ~= "" then add(pub) end
local ids = {}
if d.isbn then table.insert(ids, "ISBN " .. d.isbn) end
if d.doi then table.insert(ids, "DOI: " .. d.doi) end
if d.url then
if d.access then table.insert(ids, "sótt " .. d.access .. " af " .. d.url)
else table.insert(ids, d.url) end
end
if #ids > 0 then add(table.concat(ids, ", ")) end
if d.note then add("(" .. d.note .. ")") end
local result = table.concat(b, ". ")
return (string.gsub(result, "%.%s*%.+", ".")) -- Fix double periods cleanly
-----------------------------------------------------
-- 2. JOURNAL (Tímarit)
-----------------------------------------------------
elseif tegund == "timarit" or tegund == "tímarit" then
if auth then add(auth) end
if d.year then add("(" .. d.year .. ")") end
if d.title then add(d.title) end
local j_parts = {}
if d.container then table.insert(j_parts, d.container) end
local vol_iss = ""
if d.volume then
vol_iss = d.volume
if d.issue then vol_iss = vol_iss .. "(" .. d.issue .. ")" end
elseif d.issue then
vol_iss = "(" .. d.issue .. ")"
end
if vol_iss ~= "" then table.insert(j_parts, vol_iss) end
if d.pages then table.insert(j_parts, "s. " .. d.pages) end
if #j_parts > 0 then add(table.concat(j_parts, ", ")) end
local ids = {}
if d.issn then table.insert(ids, "ISSN " .. d.issn) end
if d.doi then table.insert(ids, "DOI: " .. d.doi) end
if d.url then
if d.access then table.insert(ids, "sótt " .. d.access .. " af " .. d.url)
else table.insert(ids, d.url) end
end
if #ids > 0 then add(table.concat(ids, ", ")) end
if d.note then add("(" .. d.note .. ")") end
local result = table.concat(b, ". ")
return (string.gsub(result, "%.%s*%.+", "."))
-----------------------------------------------------
-- 3. WEB (Vefur)
-----------------------------------------------------
elseif tegund == "vef" or tegund == "vefsíða" then
if auth then add(auth) end
if d.year then add("(" .. d.year .. ")") end
local t = d.title or ""
if d.format then t = t .. " [" .. d.format .. "]" end
if t ~= "" then add(t) end
if d.publisher then add(d.publisher)
elseif d.container then add(d.container) end
if d.url then
if d.access then add("sótt " .. d.access .. " af " .. d.url)
else add(d.url) end
end
if d.note then add("(" .. d.note .. ")") end
local result = table.concat(b, ". ")
return (string.gsub(result, "%.%s*%.+", "."))
-----------------------------------------------------
-- 4. BOOK CHAPTER (Kafli - "Í ritstjóri (ritstj.), Bók")
-----------------------------------------------------
elseif tegund == "kafli" or tegund == "bókarkafli" then
if auth then add(auth) end
if d.year then add("(" .. d.year .. ")") end
if d.chapter then add(d.chapter)
elseif d.title then add(d.title) end
local cont_parts = {}
if d.editors then table.insert(cont_parts, d.editors .. " (ritstj.)") end
if d.container then table.insert(cont_parts, d.container)
elseif d.title and d.chapter then table.insert(cont_parts, d.title) end
local p_mods = {}
if d.edition then table.insert(p_mods, d.edition .. " útg.") end
if d.volume then table.insert(p_mods, "árg. " .. d.volume) end
if d.pages then table.insert(p_mods, "s. " .. d.pages) end
local cont_str = ""
if #cont_parts > 0 then
cont_str = "Í " .. table.concat(cont_parts, ", ")
if #p_mods > 0 then cont_str = cont_str .. " (" .. table.concat(p_mods, ", ") .. ")" end
add(cont_str)
end
local pub = ""
if d.location and d.publisher then pub = d.location .. ": " .. d.publisher
elseif d.publisher then pub = d.publisher
elseif d.location then pub = d.location end
if pub ~= "" then add(pub) end
local ids = {}
if d.isbn then table.insert(ids, "ISBN " .. d.isbn) end
if d.doi then table.insert(ids, "DOI: " .. d.doi) end
if d.url then
if d.access then table.insert(ids, "sótt " .. d.access .. " af " .. d.url)
else table.insert(ids, d.url) end
end
if #ids > 0 then add(table.concat(ids, ", ")) end
local result = table.concat(b, ". ")
return (string.gsub(result, "%.%s*%.+", "."))
-----------------------------------------------------
-- 5. GENERIC / FALLBACK (Original module logic)
-----------------------------------------------------
else
local parts = {}
if d.mainauthor then table.insert(parts, format_names(d.mainauthor)) end
if d.quotee then table.insert(parts, "tilvitnun í " .. d.quotee) end
if d.email then table.insert(parts, "tölvupóstur frá " .. d.email) end
local creator = d.authors or d.artist
if creator then
if d.year then table.insert(parts, creator .. " (" .. d.year .. ")")
else table.insert(parts, creator) end
elseif d.year then
table.insert(parts, "(" .. d.year .. ")")
end
if d.title then
local t = d.title
local mods = {}
if d.format then table.insert(mods, d.format) end
if d.medium then table.insert(mods, d.medium) end
if d.genre then table.insert(mods, d.genre) end
if #mods > 0 then t = t .. " [" .. table.concat(mods, ", ") .. "]" end
table.insert(parts, t)
end
if d.translator then table.insert(parts, "þýtt af " .. d.translator) end
if d.director then table.insert(parts, "leikstýrt af " .. d.director) end
if d.composer then table.insert(parts, "tónlist eftir " .. d.composer) end
if d.lyricist then table.insert(parts, "texti eftir " .. d.lyricist) end
if d.actor then
local act = "leikið af " .. d.actor
if d.role then act = act .. " í hlutverki " .. d.role end
table.insert(parts, act)
end
if d.feat then table.insert(parts, "með framkomu frá " .. d.feat) end
if d.compiler then table.insert(parts, "tekið saman af " .. d.compiler) end
local cont = ""
if d.editors or d.container or d.album or d.mailing_list then
cont = "í "
if d.editors then cont = cont .. d.editors .. " (ritstj.), " end
if d.container then cont = cont .. d.container
elseif d.album then cont = cont .. apply_style(d.album, "italic")
elseif d.mailing_list then cont = cont .. "póstlistanum " .. d.mailing_list end
end
if cont ~= "" and cont ~= "í " then table.insert(parts, mw.text.trim(cont, ", ")) end
if d.series then table.insert(parts, "ritröð: " .. d.series) end
if d.network then table.insert(parts, d.network) end
if d.legislative then table.insert(parts, d.legislative) end
if d.report then table.insert(parts, d.report)
elseif d.legislative and not d.report then table.insert(parts, "þingræða") end
if d.volume then table.insert(parts, "árg. " .. d.volume) end
if d.issue then table.insert(parts, "tbl. " .. d.issue) end
if d.edition then table.insert(parts, d.edition .. " útg.") end
if d.version then table.insert(parts, "útgáfa " .. d.version) end
if d.system then table.insert(parts, d.system) end
if d.chapter then table.insert(parts, "kafli: " .. d.chapter)
elseif d.chapter_num then table.insert(parts, d.chapter_num .. ". kafli") end
if d.section then table.insert(parts, "hluti: " .. d.section)
elseif d.section_num then table.insert(parts, d.section_num .. ". hluti") end
if d.episode then table.insert(parts, "þáttur: " .. d.episode) end
if d.scene then table.insert(parts, "atriði: " .. d.scene) end
if d.level then table.insert(parts, "borð: " .. d.level) end
local pub = ""
if d.location then pub = d.location end
if d.publisher then
if pub ~= "" then pub = pub .. ": " .. d.publisher
else pub = d.publisher end
end
if pub ~= "" then table.insert(parts, pub) end
if d.pages then table.insert(parts, "s. " .. d.pages) end
if d.column then table.insert(parts, "dálkur " .. d.column) end
if d.line then table.insert(parts, "lína " .. d.line) end
if d.time then table.insert(parts, d.time) end
if d.doi then table.insert(parts, "DOI: " .. d.doi) end
if d.isbn then table.insert(parts, "ISBN " .. d.isbn) end
if d.issn then table.insert(parts, "ISSN " .. d.issn) end
if d.jstor then table.insert(parts, "JSTOR " .. d.jstor) end
if d.lccn then table.insert(parts, "LCCN " .. d.lccn) end
if d.oclc then table.insert(parts, "OCLC " .. d.oclc) end
if d.ol then table.insert(parts, "OL " .. d.ol) end
if d.pmid then table.insert(parts, "PMID " .. d.pmid) end
if d.pmcid then table.insert(parts, "PMCID " .. d.pmcid) end
if d.bibcode then table.insert(parts, "Bibcode: " .. d.bibcode) end
if d.message_id then table.insert(parts, "Message-ID: " .. d.message_id) end
if d.id then table.insert(parts, d.id) end
if d.url then
if d.access then table.insert(parts, "sótt " .. d.access .. " af " .. d.url)
else table.insert(parts, d.url) end
end
if d.note then table.insert(parts, "(" .. d.note .. ")") end
return table.concat(parts, ", ")
end
end
function p.tilvisun(frame)
local args = frame:getParent().args
if not args['höfundur'] and not args['titill'] and not args['author'] then
args = frame.args
end
local d1 = extract_data(args, "")
local d2 = extract_data(args, "-2")
local final_str = ""
if not d1.is_empty then
final_str = build_citation(d1, false)
end
if not d2.is_empty then
local p2_str = build_citation(d2, true)
local tenging = get_arg(args, 'tenging', "") or "endurprentað í"
if final_str ~= "" then
final_str = final_str .. "; " .. tenging .. " " .. p2_str
else
final_str = p2_str
end
end
return final_str
end
return p
3s5iwykqom76bwg45ry5vt0kv7paasz
392446
392444
2026-08-30T09:44:50Z
Ow! That Hurts!
8952
392446
Scribunto
text/plain
local p = {}
local metadata = mw.loadData('Module:tilvísun/data')
-- Helper: Fetch argument, checking aliases natively, allowing for suffix (-2)
local function get_arg(args, key, suffix)
suffix = suffix or ""
local val = args[key .. suffix]
if not val or val == "" then
for alias, standard_key in pairs(metadata.aliases) do
if standard_key == key then
local alias_key = alias .. suffix
if args[alias_key] and args[alias_key] ~= "" then
val = args[alias_key]
break
end
end
end
end
if val and val ~= "" then return mw.text.trim(val) end
return nil
end
-- Helper: Inline translations like <þ:Dagarnar>
local function parse_translation(text)
if not text then return nil, nil end
local trans = string.match(text, "<þ:(.-)>")
if trans then
local base = string.gsub(text, "%s*<þ:.->", "")
return mw.text.trim(base), mw.text.trim(trans)
end
return text, nil
end
-- Helper: Safe styling
local function apply_style(text, style)
if not text then return "" end
if style == "italic" then return "''" .. text .. "''"
elseif style == "quotes" then return "„" .. text .. "“" end
return text
end
-- Helper: Small Caps HTML wrapper
local function small_caps(text)
if not text or text == "" then return "" end
return '<span style="font-variant: small-caps;">' .. text .. '</span>'
end
-- Helper: Format semicolon-separated names with "og"
local function format_names(name_str)
if not name_str then return nil end
local names = {}
for name in string.gmatch(name_str, "([^;]+)") do
table.insert(names, small_caps(mw.text.trim(name)))
end
if #names == 0 then return nil end
local result_str = names[1]
if #names == 2 then result_str = names[1] .. " og " .. names[2]
elseif #names > 2 then
result_str = ""
for j = 1, #names do
if j == 1 then result_str = names[j]
elseif j == #names then result_str = result_str .. ", og " .. names[j]
else result_str = result_str .. ", " .. names[j] end
end
end
return result_str
end
-- DATA EXTRACTOR
local function extract_data(args, suffix)
local d = {}
local raw_tegund = get_arg(args, 'tegund', suffix) or get_arg(args, 'type', suffix) or "vef"
raw_tegund = mw.ustring.lower(raw_tegund)
if raw_tegund == "bók" then raw_tegund = "bok" end
if raw_tegund == "tímarit" then raw_tegund = "timarit" end
if raw_tegund == "bókarkafli" then raw_tegund = "bok" end -- Force legacy chapter tags into book
d.tegund = raw_tegund
local rules = metadata.format_rules[raw_tegund] or metadata.format_rules["vef"] or { title_style = "italic", container_style = "plain" }
-- Core & Roles
d.mainauthor = get_arg(args, 'aðalhöfundur', suffix) or get_arg(args, 'mainauthor', suffix)
d.authors = get_arg(args, 'höfundur', suffix) or get_arg(args, 'author', suffix)
if d.authors then d.authors = format_names(d.authors) end
d.editors = format_names(get_arg(args, 'ritstjóri', suffix) or get_arg(args, 'editor', suffix))
d.compiler = format_names(get_arg(args, 'samantekt', suffix) or get_arg(args, 'compiler', suffix))
d.quotee = format_names(get_arg(args, 'tilvitnaður', suffix) or get_arg(args, 'quotee', suffix))
d.translator = format_names(get_arg(args, 'þýðandi', suffix) or get_arg(args, 'translator', suffix))
-- Media Roles
d.director = format_names(get_arg(args, 'leikstjóri', suffix) or get_arg(args, 'director', suffix))
d.actor = format_names(get_arg(args, 'leikari', suffix) or get_arg(args, 'actor', suffix))
d.role = get_arg(args, 'hlutverk', suffix) or get_arg(args, 'role', suffix)
d.lyricist = format_names(get_arg(args, 'textahöfundur', suffix) or get_arg(args, 'lyricist', suffix))
d.composer = format_names(get_arg(args, 'tónskáld', suffix) or get_arg(args, 'composer', suffix))
d.artist = format_names(get_arg(args, 'flytjandi', suffix) or get_arg(args, 'artist', suffix))
d.feat = format_names(get_arg(args, 'með_framkomu', suffix) or get_arg(args, 'feat', suffix))
-- Date & Title Data
d.year = get_arg(args, 'dags', suffix) or get_arg(args, 'ár', suffix) or get_arg(args, 'year', suffix)
d.format = get_arg(args, 'snið', suffix) or get_arg(args, 'format', suffix)
d.genre = get_arg(args, 'tegund_efnis', suffix) or get_arg(args, 'genre', suffix)
d.medium = get_arg(args, 'miðill', suffix) or get_arg(args, 'medium', suffix)
local tit_raw = get_arg(args, 'titill', suffix) or get_arg(args, 'title', suffix)
if tit_raw then
local base_tit, inline_thyd = parse_translation(tit_raw)
local thyd = get_arg(args, 'þýðing_titils', suffix) or get_arg(args, 'trans-title', suffix) or inline_thyd
d.title = base_tit -- Styling applied in the builder for greater APA control
if thyd then d.title = d.title .. " [" .. thyd .. "]" end
end
-- Containers
local tim_raw = get_arg(args, 'tímarit', suffix) or get_arg(args, 'journal', suffix)
if tim_raw then
local base_tim, inline_thyd = parse_translation(tim_raw)
d.container = base_tim
if inline_thyd then d.container = d.container .. " [" .. inline_thyd .. "]" end
end
d.album = get_arg(args, 'albúm', suffix) or get_arg(args, 'album', suffix)
d.series = get_arg(args, 'ritröð', suffix) or get_arg(args, 'series', suffix)
d.network = get_arg(args, 'sjónvarpsstöð', suffix) or get_arg(args, 'network', suffix)
-- Locators & Positions
d.volume = get_arg(args, 'árgangur', suffix) or get_arg(args, 'volume', suffix)
d.issue = get_arg(args, 'tölublað', suffix) or get_arg(args, 'issue', suffix)
d.edition = get_arg(args, 'útgáfa', suffix) or get_arg(args, 'edition', suffix)
d.chapter = get_arg(args, 'kafli', suffix) or get_arg(args, 'chapter', suffix)
d.pages = get_arg(args, 'síður', suffix) or get_arg(args, 'síða', suffix) or get_arg(args, 'pages', suffix)
-- Publication Info
d.location = get_arg(args, 'útgáfustaður', suffix) or get_arg(args, 'location', suffix)
d.publisher = get_arg(args, 'útgefandi', suffix) or get_arg(args, 'publisher', suffix)
-- Special Types (Theses, Reports)
d.report = get_arg(args, 'skýrsla', suffix) or get_arg(args, 'report', suffix)
d.thesis_type = get_arg(args, 'ritgerðartegund', suffix) or get_arg(args, 'thesis type', suffix)
d.university = get_arg(args, 'háskóli', suffix) or get_arg(args, 'university', suffix)
-- Identifiers
d.doi = get_arg(args, 'doi', suffix)
d.isbn = get_arg(args, 'isbn', suffix)
d.issn = get_arg(args, 'issn', suffix)
d.url = get_arg(args, 'vefslóð', suffix) or get_arg(args, 'url', suffix)
d.access = get_arg(args, 'sótt', suffix) or get_arg(args, 'access-date', suffix)
d.note = get_arg(args, 'athugasemd', suffix) or get_arg(args, 'note', suffix)
d.is_empty = not (d.authors or d.artist or d.year or d.title or d.container or d.publisher or d.url or d.album)
return d
end
-- BUILDER
local function build_citation(d, is_part2)
local b = {}
local tegund = d.tegund or "vef"
local function add(text)
if text and text ~= "" then table.insert(b, mw.text.trim(text)) end
end
local auth = d.authors or (d.mainauthor and format_names(d.mainauthor))
-----------------------------------------------------
-- 1. BOOK & BOOK CHAPTER (Bók)
-----------------------------------------------------
if tegund == "bok" or tegund == "bók" then
local is_chapter = (d.chapter ~= nil) or (d.container ~= nil and d.title ~= nil)
-- Author or Editor at the front
if auth then add(auth)
elseif d.editors and not is_chapter then add(d.editors .. " (ritstj.)") end
-- Date (Falls back to á.á. per APA)
add(d.year and "(" .. d.year .. ")" or "(á.á.)")
if is_chapter then
-- CHAPTER MODE
local chap_title = d.chapter or d.title
add(chap_title)
local book_title = d.container or (d.chapter and d.title)
local cont_parts = {}
if d.editors then table.insert(cont_parts, d.editors .. " (ritstj.)") end
if book_title then table.insert(cont_parts, apply_style(book_title, "italic")) end
local p_mods = {}
if d.edition then table.insert(p_mods, d.edition .. " útg.") end
if d.volume then table.insert(p_mods, "árg. " .. d.volume) end
if d.pages then table.insert(p_mods, "s. " .. d.pages) end
if d.translator then table.insert(p_mods, d.translator .. ", þýð.") end
local cont_str = ""
if #cont_parts > 0 then
cont_str = "Í " .. table.concat(cont_parts, ", ")
if #p_mods > 0 then cont_str = cont_str .. " (" .. table.concat(p_mods, ", ") .. ")" end
add(cont_str)
elseif #p_mods > 0 then
add("(" .. table.concat(p_mods, ", ") .. ")")
end
else
-- FULL BOOK MODE
local t_parts = {}
if d.title then table.insert(t_parts, apply_style(d.title, "italic")) end
local p_mods = {}
if auth and d.editors then table.insert(p_mods, d.editors .. ", ritstj.") end
if d.translator then table.insert(p_mods, d.translator .. ", þýð.") end
if d.edition then table.insert(p_mods, d.edition .. " útg.") end
if d.volume then table.insert(p_mods, "árg. " .. d.volume) end
if d.pages then table.insert(p_mods, "s. " .. d.pages) end
if #p_mods > 0 then
if #t_parts > 0 then t_parts[1] = t_parts[1] .. " (" .. table.concat(p_mods, ", ") .. ")"
else table.insert(t_parts, "(" .. table.concat(p_mods, ", ") .. ")") end
end
if #t_parts > 0 then add(table.concat(t_parts, " ")) end
end
-- Publisher
local pub = ""
if d.location and d.publisher then pub = d.location .. ": " .. d.publisher
elseif d.publisher then pub = d.publisher
elseif d.location then pub = d.location end
if pub ~= "" then add(pub) end
-- Identifiers
local ids = {}
if d.isbn then table.insert(ids, "ISBN " .. d.isbn) end
if d.doi then table.insert(ids, "DOI: " .. d.doi) end
if d.url then table.insert(ids, (d.access and "sótt " .. d.access .. " af " or "") .. d.url) end
if #ids > 0 then add(table.concat(ids, ", ")) end
if d.note then add("(" .. d.note .. ")") end
local result = table.concat(b, ". ")
return (string.gsub(result, "%.%s*%.+", "."))
-----------------------------------------------------
-- 2. JOURNAL & MAGAZINE (Tímarit)
-----------------------------------------------------
elseif tegund == "timarit" or tegund == "tímarit" or tegund == "grein" then
if auth then add(auth) end
add(d.year and "(" .. d.year .. ")" or "(á.á.)")
if d.title then add(d.title) end
local j_parts = {}
if d.container then table.insert(j_parts, apply_style(d.container, "italic")) end
-- APA formatting: italicized Volume, plain Issue, NO space. e.g. "12(3)"
local vol_iss = ""
if d.volume then
vol_iss = apply_style(d.volume, "italic")
if d.issue then vol_iss = vol_iss .. "(" .. d.issue .. ")" end
elseif d.issue then
vol_iss = "(" .. d.issue .. ")"
end
if vol_iss ~= "" then table.insert(j_parts, vol_iss) end
-- Journal pages do not use "s." in APA
if d.pages then table.insert(j_parts, d.pages) end
if #j_parts > 0 then add(table.concat(j_parts, ", ")) end
local ids = {}
if d.issn then table.insert(ids, "ISSN " .. d.issn) end
if d.doi then table.insert(ids, "DOI: " .. d.doi) end
if d.url then table.insert(ids, (d.access and "sótt " .. d.access .. " af " or "") .. d.url) end
if #ids > 0 then add(table.concat(ids, ", ")) end
if d.note then add("(" .. d.note .. ")") end
local result = table.concat(b, ". ")
return (string.gsub(result, "%.%s*%.+", "."))
-----------------------------------------------------
-- 3. WEB (Vefur)
-----------------------------------------------------
elseif tegund == "vef" or tegund == "vefsíða" then
if auth then add(auth) end
add(d.year and "(" .. d.year .. ")" or "(á.á.)")
local t = ""
if d.title then t = apply_style(d.title, "italic") end
if d.format then t = t .. " [" .. d.format .. "]" end
if t ~= "" then add(t) end
if d.publisher then add(d.publisher)
elseif d.container then add(d.container) end
if d.url then add((d.access and "sótt " .. d.access .. " af " or "") .. d.url) end
if d.note then add("(" .. d.note .. ")") end
local result = table.concat(b, ". ")
return (string.gsub(result, "%.%s*%.+", "."))
-----------------------------------------------------
-- 4. THESIS / DISSERTATION (Ritgerð)
-----------------------------------------------------
elseif tegund == "ritgerd" or tegund == "ritgerð" then
if auth then add(auth) end
add(d.year and "(" .. d.year .. ")" or "(á.á.)")
local t = ""
if d.title then t = apply_style(d.title, "italic") end
local t_mods = {}
if d.thesis_type then table.insert(t_mods, d.thesis_type) end
if d.university then table.insert(t_mods, d.university) end
if #t_mods > 0 then t = t .. " [" .. table.concat(t_mods, ", ") .. "]" end
if t ~= "" then add(t) end
if d.publisher then add(d.publisher) end
if d.url then add((d.access and "sótt " .. d.access .. " af " or "") .. d.url) end
if d.note then add("(" .. d.note .. ")") end
local result = table.concat(b, ". ")
return (string.gsub(result, "%.%s*%.+", "."))
-----------------------------------------------------
-- 5. REPORTS (Skýrsla)
-----------------------------------------------------
elseif tegund == "skyrsla" or tegund == "skýrsla" then
if auth then add(auth) end
add(d.year and "(" .. d.year .. ")" or "(á.á.)")
local t = ""
if d.title then t = apply_style(d.title, "italic") end
if d.report then t = t .. " (Skýrsla nr. " .. d.report .. ")" end
if t ~= "" then add(t) end
if d.publisher then add(d.publisher) end
if d.url then add((d.access and "sótt " .. d.access .. " af " or "") .. d.url) end
if d.note then add("(" .. d.note .. ")") end
local result = table.concat(b, ". ")
return (string.gsub(result, "%.%s*%.+", "."))
-----------------------------------------------------
-- 6. MEDIA / FALLBACK (Original module logic)
-----------------------------------------------------
else
local parts = {}
if d.mainauthor then table.insert(parts, format_names(d.mainauthor)) end
if d.quotee then table.insert(parts, "tilvitnun í " .. d.quotee) end
local creator = d.authors or d.artist
if creator then
if d.year then table.insert(parts, creator .. " (" .. d.year .. ")")
else table.insert(parts, creator) end
elseif d.year then table.insert(parts, "(" .. d.year .. ")") end
if d.title then
local t = d.title
local mods = {}
if d.format then table.insert(mods, d.format) end
if d.medium then table.insert(mods, d.medium) end
if d.genre then table.insert(mods, d.genre) end
if #mods > 0 then t = t .. " [" .. table.concat(mods, ", ") .. "]" end
table.insert(parts, t)
end
if d.director then table.insert(parts, "leikstýrt af " .. d.director) end
if d.composer then table.insert(parts, "tónlist eftir " .. d.composer) end
if d.actor then table.insert(parts, "leikið af " .. d.actor .. (d.role and " í hlutverki " .. d.role or "")) end
local cont = ""
if d.editors or d.container or d.album then
cont = "í "
if d.editors then cont = cont .. d.editors .. " (ritstj.), " end
if d.container then cont = cont .. d.container
elseif d.album then cont = cont .. apply_style(d.album, "italic") end
end
if cont ~= "" and cont ~= "í " then table.insert(parts, mw.text.trim(cont, ", ")) end
if d.network then table.insert(parts, d.network) end
if d.volume then table.insert(parts, "árg. " .. d.volume) end
if d.issue then table.insert(parts, "tbl. " .. d.issue) end
if d.chapter then table.insert(parts, "kafli: " .. d.chapter) end
local pub = ""
if d.location and d.publisher then pub = d.location .. ": " .. d.publisher
elseif d.publisher then pub = d.publisher
elseif d.location then pub = d.location end
if pub ~= "" then table.insert(parts, pub) end
if d.pages then table.insert(parts, "s. " .. d.pages) end
if d.doi then table.insert(parts, "DOI: " .. d.doi) end
if d.url then table.insert(parts, (d.access and "sótt " .. d.access .. " af " or "") .. d.url) end
if d.note then table.insert(parts, "(" .. d.note .. ")") end
return table.concat(parts, ", ")
end
end
function p.tilvisun(frame)
local args = frame:getParent().args
if not args['höfundur'] and not args['titill'] and not args['author'] then
args = frame.args
end
local d1 = extract_data(args, "")
local d2 = extract_data(args, "-2")
local final_str = ""
if not d1.is_empty then final_str = build_citation(d1, false) end
if not d2.is_empty then
local p2_str = build_citation(d2, true)
local tenging = get_arg(args, 'tenging', "") or "endurprentað í"
if final_str ~= "" then final_str = final_str .. "; " .. tenging .. " " .. p2_str
else final_str = p2_str end
end
return final_str
end
return p
sfhl7amkazp1gtrlhop2dr3mc2fhl2b
392447
392446
2026-08-30T10:21:07Z
Ow! That Hurts!
8952
392447
Scribunto
text/plain
local p = {}
local metadata = mw.loadData('Module:tilvísun/data')
-- Helper: Fetch argument, checking aliases natively, allowing for suffix (-2)
local function get_arg(args, key, suffix)
suffix = suffix or ""
local val = args[key .. suffix]
if not val or val == "" then
for alias, standard_key in pairs(metadata.aliases) do
if standard_key == key then
local alias_key = alias .. suffix
if args[alias_key] and args[alias_key] ~= "" then
val = args[alias_key]
break
end
end
end
end
if val and val ~= "" then return mw.text.trim(val) end
return nil
end
-- Helper: Inline translations like <þ:Dagarnar> -> Title [Translated Title]
local function parse_translation(text)
if not text then return nil, nil end
local trans = string.match(text, "<þ:(.-)>")
if trans then
local base = string.gsub(text, "%s*<þ:.->", "")
return mw.text.trim(base), mw.text.trim(trans)
end
return text, nil
end
-- Helper: Process text fields that can take inline translations
local function process_translated_field(val)
if not val then return nil, nil end
local base, trans = parse_translation(val)
return base, trans
end
-- Helper: Safe styling
local function apply_style(text, style)
if not text then return "" end
if style == "italic" then return "''" .. text .. "''"
elseif style == "quotes" then return "„" .. text .. "“" end
return text
end
-- Helper: Small Caps HTML wrapper
local function small_caps(text)
if not text or text == "" then return "" end
return '<span style="font-variant: small-caps;">' .. text .. '</span>'
end
-- Helper: Format semicolon-separated names with "og"
local function format_names(name_str)
if not name_str then return nil end
local names = {}
for name in string.gmatch(name_str, "([^;]+)") do
table.insert(names, small_caps(mw.text.trim(name)))
end
if #names == 0 then return nil end
local result_str = names[1]
if #names == 2 then result_str = names[1] .. " og " .. names[2]
elseif #names > 2 then
result_str = ""
for j = 1, #names do
if j == 1 then result_str = names[j]
elseif j == #names then result_str = result_str .. ", og " .. names[j]
else result_str = result_str .. ", " .. names[j] end
end
end
return result_str
end
-- Helper to attach translation brackets if present
local function format_with_translation(base, trans)
if not base then return nil end
if trans then
return base .. " [" .. trans .. "]"
end
return base
end
-- DATA EXTRACTOR
local function extract_data(args, suffix)
local d = {}
local raw_tegund = get_arg(args, 'tegund', suffix) or get_arg(args, 'type', suffix) or "vef"
raw_tegund = mw.ustring.lower(raw_tegund)
if raw_tegund == "bók" then raw_tegund = "bok" end
if raw_tegund == "tímarit" then raw_tegund = "timarit" end
if raw_tegund == "bókarkafli" then raw_tegund = "bok" end
d.tegund = raw_tegund
-- Core & Roles
d.mainauthor = get_arg(args, 'aðalhöfundur', suffix) or get_arg(args, 'mainauthor', suffix)
d.authors = get_arg(args, 'höfundur', suffix) or get_arg(args, 'author', suffix)
if d.authors then d.authors = format_names(d.authors) end
d.editors = format_names(get_arg(args, 'ritstjóri', suffix) or get_arg(args, 'editor', suffix))
d.compiler = format_names(get_arg(args, 'samantekt', suffix) or get_arg(args, 'compiler', suffix))
d.translator = format_names(get_arg(args, 'þýðandi', suffix) or get_arg(args, 'translator', suffix))
-- Date & Title Data
d.year = get_arg(args, 'dags', suffix) or get_arg(args, 'ár', suffix) or get_arg(args, 'year', suffix)
local tit_raw = get_arg(args, 'titill', suffix) or get_arg(args, 'title', suffix)
if tit_raw then
local base_t, inline_th = parse_translation(tit_raw)
local explicit_th = get_arg(args, 'þýðing_titils', suffix) or get_arg(args, 'trans-title', suffix)
d.title = base_t
d.title_trans = explicit_th or inline_th
end
-- Chapters
local chap_raw = get_arg(args, 'kafli', suffix) or get_arg(args, 'chapter', suffix)
if chap_raw then
local base_c, inline_th = parse_translation(chap_raw)
d.chapter = base_c
d.chapter_trans = inline_th
end
-- Containers (Journals, Books, Websites)
local tim_raw = get_arg(args, 'tímarit', suffix) or get_arg(args, 'journal', suffix) or get_arg(args, 'bók', suffix) or get_arg(args, 'container', suffix)
if tim_raw then
local base_tim, inline_th = parse_translation(tim_raw)
d.container = base_tim
d.container_trans = inline_th
end
d.series = get_arg(args, 'ritröð', suffix) or get_arg(args, 'series', suffix)
-- Locators & Positions
d.volume = get_arg(args, 'árgangur', suffix) or get_arg(args, 'volume', suffix)
d.issue = get_arg(args, 'tölublað', suffix) or get_arg(args, 'issue', suffix)
d.edition = get_arg(args, 'útgáfa', suffix) or get_arg(args, 'edition', suffix)
d.pages = get_arg(args, 'síður', suffix) or get_arg(args, 'síða', suffix) or get_arg(args, 'pages', suffix)
-- Publication Info
d.location = get_arg(args, 'útgáfustaður', suffix) or get_arg(args, 'location', suffix)
d.publisher = get_arg(args, 'útgefandi', suffix) or get_arg(args, 'publisher', suffix)
-- Identifiers & Access
d.doi = get_arg(args, 'doi', suffix)
d.isbn = get_arg(args, 'isbn', suffix)
d.issn = get_arg(args, 'issn', suffix)
d.url = get_arg(args, 'vefslóð', suffix) or get_arg(args, 'url', suffix)
d.access = get_arg(args, 'sótt', suffix) or get_arg(args, 'access-date', suffix)
d.note = get_arg(args, 'athugasemd', suffix) or get_arg(args, 'note', suffix)
d.is_empty = not (d.authors or d.year or d.title or d.container or d.publisher or d.url or d.chapter)
return d
end
-- BUILDER (Wiktionary In-House Style)
local function build_citation(d, is_part2)
local parts = {}
-- 1. Author / Creator
if d.authors then
table.insert(parts, d.authors)
end
-- 2. Date in parentheses
if d.year then
table.insert(parts, "(" .. d.year .. ")")
end
-- 3. Chapter or Article Title (in guillemets)
if d.chapter then
local full_chap = format_with_translation(d.chapter, d.chapter_trans)
table.insert(parts, "„" .. full_chap .. "“")
elseif d.title then
local full_title = format_with_translation(d.title, d.title_trans)
-- If it's a book title without container, it's italicized. If it's an article/chapter, it uses quotes.
if d.container or d.tegund == "timarit" or d.tegund == "grein" then
table.insert(parts, "„" .. full_title .. "“")
else
table.insert(parts, apply_style(full_title, "italic"))
end
end
-- 4. Container / Host Publication ("í ...")
local container_parts = {}
if d.container then
local full_cont = format_with_translation(d.container, d.container_trans)
-- Books/Journals in container get italicized context
table.insert(container_parts, apply_style(full_cont, "italic"))
elseif d.title and d.chapter then
-- Fallback if title is the book/journal container for a chapter
table.insert(container_parts, apply_style(d.title, "italic"))
end
if #container_parts > 0 then
local cont_str = "í " .. table.concat(container_parts, ", ")
table.insert(parts, cont_str)
end
-- 5. Editors / Compilers within container
if d.editors then
-- Wiktionary style: inserted cleanly as "í Editor, ritstj., Container" or similar
-- We can place it right after "í" or handle role prefix
-- Example pattern from prompt: "í Erling B. Snorrason, ritstjori, Aðventfréttir..."
-- Let's inject editor info contextually
end
-- Series, Edition, Volume, Issue
if d.series then table.insert(parts, "ritröð: " .. d.series) end
if d.edition then table.insert(parts, d.edition .. " útg.") end
if d.volume then table.insert(parts, d.volume .. ". árgangur") end
if d.issue then table.insert(parts, d.issue .. ". tölublað") end
-- Location & Publisher (e.g., "Reykjavík: Kirkja...")
local pub_str = ""
if d.location then pub_str = d.location end
if d.publisher then
if pub_str ~= "" then pub_str = pub_str .. ": " .. d.publisher
else pub_str = d.publisher end
end
if pub_str ~= "" then table.insert(parts, pub_str) end
-- Translator attribution ("þýtt sem ...") handled via part2 or explicit translator field
if d.translator then
table.insert(parts, "þýtt af " .. d.translator)
end
-- Pages ("síða X" or "síður X–Y")
if d.pages then
if mw.ustring.find(d.pages, "–") or mw.ustring.find(d.pages, "-") then
table.insert(parts, "síður " .. d.pages)
else
table.insert(parts, "síða " .. d.pages)
end
end
-- URLs and access dates
if d.url then
if d.access then table.insert(parts, "sótt " .. d.access .. " af " .. d.url)
else table.insert(parts, d.url) end
end
-- Combine with commas and semicolons matching Wiktionary style
return table.concat(parts, ", ")
end
function p.tilvisun(frame)
local args = frame:getParent().args
if not args['höfundur'] and not args['titill'] and not args['author'] then
args = frame.args
end
local d1 = extract_data(args, "")
local d2 = extract_data(args, "-2")
local final_str = ""
if not d1.is_empty then
final_str = build_citation(d1, false)
end
if not d2.is_empty then
local p2_str = build_citation(d2, true)
local tenging = get_arg(args, 'tenging', "") or "þýtt sem"
if final_str ~= "" then
-- Wiktionary style usually connects secondary citations with semicolons: "; þýtt sem “...”, í ..."
final_str = final_str .. "; " .. tenging .. " " .. p2_str
else
final_str = p2_str
end
end
return final_str
end
return p
rqq1e4fqs9wbjhhmjgpj32nbips98ii
392448
392447
2026-08-30T10:28:22Z
Ow! That Hurts!
8952
392448
Scribunto
text/plain
local p = {}
local metadata = mw.loadData('Module:tilvísun/data')
-- Helper: Fetch argument, checking aliases natively, allowing for suffix (-2)
local function get_arg(args, key, suffix)
suffix = suffix or ""
local val = args[key .. suffix]
if not val or val == "" then
for alias, standard_key in pairs(metadata.aliases) do
if standard_key == key then
local alias_key = alias .. suffix
if args[alias_key] and args[alias_key] ~= "" then
val = args[alias_key]
break
end
end
end
end
if val and val ~= "" then return mw.text.trim(val) end
return nil
end
-- Helper: Parse inline translations like <þ:Dagarnar> and apply style correctly
-- Ensures brackets and translation text are NEVER italicized.
local function format_field(text, style)
if not text or text == "" then return nil end
local trans = string.match(text, "<þ:(.-)>")
local base = text
if trans then
base = string.gsub(text, "%s*<þ:.->", "")
end
base = mw.text.trim(base)
trans = trans and mw.text.trim(trans) or nil
if style == "quotes" then
local inner = base
if trans then inner = inner .. " [" .. trans .. "]" end
return "„" .. inner .. "“"
elseif style == "italic" then
local styled_base = "''" .. base .. "''"
if trans then
return styled_base .. " [" .. trans .. "]"
end
return styled_base
else
if trans then
return base .. " [" .. trans .. "]"
end
return base
end
end
-- Helper: Small Caps HTML wrapper
local function small_caps(text)
if not text or text == "" then return "" end
return '<span style="font-variant: small-caps;">' .. text .. '</span>'
end
-- Helper: Format semicolon-separated names with "og"
local function format_names(name_str)
if not name_str then return nil end
local names = {}
for name in string.gmatch(name_str, "([^;]+)") do
table.insert(names, small_caps(mw.text.trim(name)))
end
if #names == 0 then return nil end
local result_str = names[1]
if #names == 2 then result_str = names[1] .. " og " .. names[2]
elseif #names > 2 then
result_str = ""
for j = 1, #names do
if j == 1 then result_str = names[j]
elseif j == #names then result_str = result_str .. ", og " .. names[j]
else result_str = result_str .. ", " .. names[j] end
end
end
return result_str
end
-- DATA EXTRACTOR
local function extract_data(args, suffix)
local d = {}
local raw_tegund = get_arg(args, 'tegund', suffix) or get_arg(args, 'type', suffix) or "vef"
raw_tegund = mw.ustring.lower(raw_tegund)
if raw_tegund == "bók" then raw_tegund = "bok" end
if raw_tegund == "tímarit" then raw_tegund = "timarit" end
if raw_tegund == "bókarkafli" then raw_tegund = "bok" end
d.tegund = raw_tegund
-- Core & Roles
d.mainauthor = get_arg(args, 'aðalhöfundur', suffix) or get_arg(args, 'mainauthor', suffix)
d.authors = get_arg(args, 'höfundur', suffix) or get_arg(args, 'author', suffix)
if d.authors then d.authors = format_names(d.authors) end
d.editors = format_names(get_arg(args, 'ritstjóri', suffix) or get_arg(args, 'editor', suffix))
-- Date & Titles (Stored raw to allow universal <þ:> parsing in builder)
d.year = get_arg(args, 'dags', suffix) or get_arg(args, 'ár', suffix) or get_arg(args, 'year', suffix)
d.title = get_arg(args, 'titill', suffix) or get_arg(args, 'title', suffix)
d.chapter = get_arg(args, 'kafli', suffix) or get_arg(args, 'chapter', suffix)
-- Containers
d.container = get_arg(args, 'tímarit', suffix) or get_arg(args, 'journal', suffix) or get_arg(args, 'albúm', suffix) or get_arg(args, 'album', suffix)
-- Locators & Positions
d.volume = get_arg(args, 'árgangur', suffix) or get_arg(args, 'volume', suffix)
d.issue = get_arg(args, 'tölublað', suffix) or get_arg(args, 'issue', suffix)
d.pages = get_arg(args, 'síður', suffix) or get_arg(args, 'síða', suffix) or get_arg(args, 'pages', suffix)
-- Publication Info
d.location = get_arg(args, 'útgáfustaður', suffix) or get_arg(args, 'location', suffix)
d.publisher = get_arg(args, 'útgefandi', suffix) or get_arg(args, 'publisher', suffix)
-- Identifiers & URLs
d.doi = get_arg(args, 'doi', suffix)
d.isbn = get_arg(args, 'isbn', suffix)
d.issn = get_arg(args, 'issn', suffix)
d.url = get_arg(args, 'vefslóð', suffix) or get_arg(args, 'url', suffix)
d.access = get_arg(args, 'sótt', suffix) or get_arg(args, 'access-date', suffix)
d.note = get_arg(args, 'athugasemd', suffix) or get_arg(args, 'note', suffix)
d.is_empty = not (d.authors or d.year or d.title or d.container or d.publisher or d.url)
return d
end
-- BUILDER (Wiktionary In-House Citation Style)
local function build_citation(d, is_part2)
local parts = {}
local tegund = d.tegund or "vef"
-- 1. Author / Creator
local auth = d.authors or (d.mainauthor and format_names(d.mainauthor))
if auth then
table.insert(parts, auth)
end
-- 2. Date
if d.year then
if auth then
parts[#parts] = parts[#parts] .. " (" .. d.year .. ")"
else
table.insert(parts, "(" .. d.year .. ")")
end
end
-- 3. Title or Chapter
if d.chapter then
table.insert(parts, format_field(d.chapter, "quotes"))
elseif d.title then
local title_style = (tegund == "bok" or tegund == "bók") and "italic" or "quotes"
table.insert(parts, format_field(d.title, title_style))
end
-- 4. Container / Journal / Book details
local cont_parts = {}
if d.editors then
table.insert(cont_parts, d.editors .. ", ritstj.")
end
if d.container then
table.insert(cont_parts, format_field(d.container, "italic"))
elseif (tegund == "bok" or tegund == "bók") and d.chapter and d.title then
table.insert(cont_parts, format_field(d.title, "italic"))
end
local container_str = ""
if #cont_parts > 0 then
container_str = "í " .. table.concat(cont_parts, ", ")
end
local loc_parts = {}
if d.volume then
table.insert(loc_parts, d.volume .. ". árgangur")
end
if d.issue then
table.insert(loc_parts, d.issue .. ". tölublað")
end
local pub_str = ""
if d.location and d.publisher then
pub_str = d.location .. ": " .. d.publisher
elseif d.publisher then
pub_str = d.publisher
elseif d.location then
pub_str = d.location
end
if pub_str ~= "" then
table.insert(loc_parts, pub_str)
end
if d.pages then
table.insert(loc_parts, d.pages)
end
if container_str ~= "" then
local full_cont = container_str
if #loc_parts > 0 then
full_cont = full_cont .. ", " .. table.concat(loc_parts, ", ")
end
table.insert(parts, full_cont)
elseif #loc_parts > 0 then
table.insert(parts, table.concat(loc_parts, ", "))
end
-- Identifiers & URLs
local ids = {}
if d.doi then table.insert(ids, "DOI: " .. d.doi) end
if d.isbn then table.insert(ids, "ISBN " .. d.isbn) end
if d.issn then table.insert(ids, "ISSN " .. d.issn) end
if d.url then
if d.access then table.insert(ids, "sótt " .. d.access .. " af " .. d.url)
else table.insert(ids, d.url) end
end
if #ids > 0 then
table.insert(parts, table.concat(ids, ", "))
end
if d.note then
table.insert(parts, "(" .. d.note .. ")")
end
return table.concat(parts, ", ")
end
function p.tilvisun(frame)
local args = frame:getParent().args
if not args['höfundur'] and not args['titill'] and not args['author'] then
args = frame.args
end
local d1 = extract_data(args, "")
local d2 = extract_data(args, "-2")
local final_str = ""
if not d1.is_empty then
final_str = build_citation(d1, false)
end
if not d2.is_empty then
local p2_str = build_citation(d2, true)
local tenging = get_arg(args, 'tenging', "") or "þýtt sem"
if final_str ~= "" then
final_str = final_str .. "; " .. tenging .. " " .. p2_str
else
final_str = p2_str
end
end
return final_str
end
return p
mgk4omff7w8axj8wjai4ads3oat3iy9
392449
392448
2026-08-30T10:33:45Z
Ow! That Hurts!
8952
392449
Scribunto
text/plain
local p = {}
local metadata = mw.loadData('Module:tilvísun/data')
-- Helper: Fetch argument, checking aliases natively, allowing for suffix (-2)
local function get_arg(args, key, suffix)
suffix = suffix or ""
local val = args[key .. suffix]
if not val or val == "" then
for alias, standard_key in pairs(metadata.aliases) do
if standard_key == key then
local alias_key = alias .. suffix
if args[alias_key] and args[alias_key] ~= "" then
val = args[alias_key]
break
end
end
end
end
if val and val ~= "" then return mw.text.trim(val) end
return nil
end
-- Helper: Parse inline translations like <þ:Dagarnar> and apply style correctly
-- Ensures brackets and translation text are NEVER italicized.
local function format_field(text, style)
if not text or text == "" then return nil end
local trans = string.match(text, "<þ:(.-)>")
local base = text
if trans then
base = string.gsub(text, "%s*<þ:.->", "")
end
base = mw.text.trim(base)
trans = trans and mw.text.trim(trans) or nil
if style == "quotes" then
local inner = base
if trans then inner = inner .. " [" .. trans .. "]" end
return "„" .. inner .. "“"
elseif style == "italic" then
local styled_base = "''" .. base .. "''"
if trans then
return styled_base .. " [" .. trans .. "]"
end
return styled_base
else
if trans then
return base .. " [" .. trans .. "]"
end
return base
end
end
-- Helper: Small Caps HTML wrapper
local function small_caps(text)
if not text or text == "" then return "" end
return '<span style="font-variant: small-caps;">' .. text .. '</span>'
end
-- Helper: Format semicolon-separated names with "og"
local function format_names(name_str)
if not name_str then return nil end
local names = {}
for name in string.gmatch(name_str, "([^;]+)") do
table.insert(names, small_caps(mw.text.trim(name)))
end
if #names == 0 then return nil end
local result_str = names[1]
if #names == 2 then result_str = names[1] .. " og " .. names[2]
elseif #names > 2 then
result_str = ""
for j = 1, #names do
if j == 1 then result_str = names[j]
elseif j == #names then result_str = result_str .. ", og " .. names[j]
else result_str = result_str .. ", " .. names[j] end
end
end
return result_str
end
-- DATA EXTRACTOR
local function extract_data(args, suffix)
local d = {}
local raw_tegund = get_arg(args, 'tegund', suffix) or get_arg(args, 'type', suffix) or "vef"
raw_tegund = mw.ustring.lower(raw_tegund)
if raw_tegund == "bók" then raw_tegund = "bok" end
if raw_tegund == "tímarit" then raw_tegund = "timarit" end
if raw_tegund == "bókarkafli" then raw_tegund = "bok" end
d.tegund = raw_tegund
-- Core & Roles
d.mainauthor = get_arg(args, 'aðalhöfundur', suffix) or get_arg(args, 'mainauthor', suffix)
d.authors = get_arg(args, 'höfundur', suffix) or get_arg(args, 'author', suffix)
if d.authors then d.authors = format_names(d.authors) end
d.editors = format_names(get_arg(args, 'ritstjóri', suffix) or get_arg(args, 'editor', suffix))
-- Date & Titles
d.year = get_arg(args, 'dags', suffix) or get_arg(args, 'ár', suffix) or get_arg(args, 'year', suffix)
d.title = get_arg(args, 'titill', suffix) or get_arg(args, 'title', suffix)
d.chapter = get_arg(args, 'kafli', suffix) or get_arg(args, 'chapter', suffix)
-- Containers
d.container = get_arg(args, 'tímarit', suffix) or get_arg(args, 'journal', suffix) or get_arg(args, 'albúm', suffix) or get_arg(args, 'album', suffix)
-- Locators & Positions
d.volume = get_arg(args, 'árgangur', suffix) or get_arg(args, 'volume', suffix)
d.issue = get_arg(args, 'tölublað', suffix) or get_arg(args, 'issue', suffix)
d.pages = get_arg(args, 'síður', suffix) or get_arg(args, 'síða', suffix) or get_arg(args, 'pages', suffix)
-- Publication Info
d.location = get_arg(args, 'útgáfustaður', suffix) or get_arg(args, 'location', suffix)
d.publisher = get_arg(args, 'útgefandi', suffix) or get_arg(args, 'publisher', suffix)
-- Identifiers & URLs
d.doi = get_arg(args, 'doi', suffix)
d.isbn = get_arg(args, 'isbn', suffix)
d.issn = get_arg(args, 'issn', suffix)
d.url = get_arg(args, 'vefslóð', suffix) or get_arg(args, 'url', suffix)
d.access = get_arg(args, 'sótt', suffix) or get_arg(args, 'access-date', suffix)
d.note = get_arg(args, 'athugasemd', suffix) or get_arg(args, 'note', suffix)
d.is_empty = not (d.authors or d.year or d.title or d.container or d.publisher or d.url)
return d
end
-- BUILDER (Flexible Type-Aware Wiktionary Citation Style)
local function build_citation(d, is_part2)
local tegund = d.tegund or "vef"
local auth_date = ""
-- 1. Author and Date construction
local auth = d.authors or (d.mainauthor and format_names(d.mainauthor))
if auth then
if d.year then
auth_date = auth .. " (" .. d.year .. ")"
else
auth_date = auth
end
else
if d.year then
auth_date = "(" .. d.year .. ")"
end
end
local body_parts = {}
if tegund == "bok" or tegund == "bók" then
-- Book format: Author (Year). Title. Location: Publisher.
if d.chapter then
table.insert(body_parts, format_field(d.chapter, "quotes"))
if d.title then
local container_desc = "í " .. format_field(d.title, "italic")
if d.editors then container_desc = container_desc .. ", ritstj. eftir " .. d.editors end
table.insert(body_parts, container_desc)
end
elseif d.title then
table.insert(body_parts, format_field(d.title, "italic"))
end
if d.editors and not d.chapter then
table.insert(body_parts, d.editors .. ", ritstj.")
end
local pub_parts = {}
if d.location and d.publisher then
table.insert(pub_parts, d.location .. ": " .. d.publisher)
elseif d.publisher then
table.insert(pub_parts, d.publisher)
elseif d.location then
table.insert(pub_parts, d.location)
end
if #pub_parts > 0 then
table.insert(body_parts, table.concat(pub_parts, ", "))
end
if d.pages then
table.insert(body_parts, d.pages)
end
elseif tegund == "timarit" or tegund == "tímarit" then
-- Journal format: Author (Year). Title. í Journal, volume, issue, pages.
if d.chapter then
table.insert(body_parts, format_field(d.chapter, "quotes"))
elseif d.title then
table.insert(body_parts, format_field(d.title, "quotes"))
end
local container_parts = {}
if d.editors then
table.insert(container_parts, d.editors .. ", ritstj.")
end
if d.container then
table.insert(container_parts, format_field(d.container, "italic"))
end
if #container_parts > 0 then
table.insert(body_parts, "í " .. table.concat(container_parts, ", "))
end
local loc_parts = {}
if d.volume then table.insert(loc_parts, d.volume .. ". árgangur") end
if d.issue then table.insert(loc_parts, d.issue .. ". tölublað") end
local pub_str = ""
if d.location and d.publisher then
pub_str = d.location .. ": " .. d.publisher
elseif d.publisher then
pub_str = d.publisher
elseif d.location then
pub_str = d.location
end
if pub_str ~= "" then table.insert(loc_parts, pub_str) end
if d.pages then table.insert(loc_parts, d.pages) end
if #loc_parts > 0 then
table.insert(body_parts, table.concat(loc_parts, ", "))
end
else
-- Website / Default format (`vef`)
if d.chapter then
table.insert(body_parts, format_field(d.chapter, "quotes"))
elseif d.title then
table.insert(body_parts, format_field(d.title, "quotes"))
end
if d.container then
table.insert(body_parts, format_field(d.container, "italic"))
end
if d.pages then
table.insert(body_parts, d.pages)
end
end
-- Identifiers & URLs & Notes
local ids = {}
if d.doi then table.insert(ids, "DOI: " .. d.doi) end
if d.isbn then table.insert(ids, "ISBN " .. d.isbn) end
if d.issn then table.insert(ids, "ISSN " .. d.issn) end
if d.url then
if d.access then table.insert(ids, "sótt " .. d.access .. " af " .. d.url)
else table.insert(ids, d.url) end
end
if #ids > 0 then
table.insert(body_parts, table.concat(ids, ", "))
end
if d.note then
table.insert(body_parts, "(" .. d.note .. ")")
end
-- Assemble final citation string
local final_parts = {}
if auth_date ~= "" then
table.insert(final_parts, auth_date)
end
if #body_parts > 0 then
table.insert(final_parts, table.concat(body_parts, ", "))
end
return table.concat(final_parts, ", ")
end
function p.tilvisun(frame)
local args = frame:getParent().args
if not args['höfundur'] and not args['titill'] and not args['author'] then
args = frame.args
end
local d1 = extract_data(args, "")
local d2 = extract_data(args, "-2")
local final_str = ""
if not d1.is_empty then
final_str = build_citation(d1, false)
end
if not d2.is_empty then
local p2_str = build_citation(d2, true)
local tenging = get_arg(args, 'tenging', "") or "þýtt sem"
if final_str ~= "" then
final_str = final_str .. "; " .. tenging .. " " .. p2_str
else
final_str = p2_str
end
end
return final_str
end
return p
t39otx38trz70xip1ai2d7nl41x7iyy
392450
392449
2026-08-30T10:36:11Z
Ow! That Hurts!
8952
392450
Scribunto
text/plain
local p = {}
local metadata = mw.loadData('Module:tilvísun/data')
-- Helper: Fetch argument, checking aliases natively, allowing for suffix (-2)
local function get_arg(args, key, suffix)
suffix = suffix or ""
local val = args[key .. suffix]
if not val or val == "" then
for alias, standard_key in pairs(metadata.aliases) do
if standard_key == key then
local alias_key = alias .. suffix
if args[alias_key] and args[alias_key] ~= "" then
val = args[alias_key]
break
end
end
end
end
if val and val ~= "" then return mw.text.trim(val) end
return nil
end
-- Helper: Parse inline translations like <þ:Dagarnar> and apply style correctly
-- Ensures brackets and translation text are NEVER italicized.
local function format_field(text, style)
if not text or text == "" then return nil end
local trans = string.match(text, "<þ:(.-)>")
local base = text
if trans then
base = string.gsub(text, "%s*<þ:.->", "")
end
base = mw.text.trim(base)
trans = trans and mw.text.trim(trans) or nil
if style == "quotes" then
local inner = base
if trans then inner = inner .. " [" .. trans .. "]" end
return "„" .. inner .. "“"
elseif style == "italic" then
local styled_base = "''" .. base .. "''"
if trans then
return styled_base .. " [" .. trans .. "]"
end
return styled_base
else
if trans then
return base .. " [" .. trans .. "]"
end
return base
end
end
-- Helper: Small Caps HTML wrapper
local function small_caps(text)
if not text or text == "" then return "" end
return '<span style="font-variant: small-caps;">' .. text .. '</span>'
end
-- Helper: Format semicolon-separated names with "og"
local function format_names(name_str)
if not name_str then return nil end
local names = {}
for name in string.gmatch(name_str, "([^;]+)") do
table.insert(names, small_caps(mw.text.trim(name)))
end
if #names == 0 then return nil end
local result_str = names[1]
if #names == 2 then result_str = names[1] .. " og " .. names[2]
elseif #names > 2 then
result_str = ""
for j = 1, #names do
if j == 1 then result_str = names[j]
elseif j == #names then result_str = result_str .. ", og " .. names[j]
else result_str = result_str .. ", " .. names[j] end
end
end
return result_str
end
-- DATA EXTRACTOR
local function extract_data(args, suffix)
local d = {}
local raw_tegund = get_arg(args, 'tegund', suffix) or get_arg(args, 'type', suffix) or "vef"
raw_tegund = mw.ustring.lower(raw_tegund)
if raw_tegund == "bók" then raw_tegund = "bok" end
if raw_tegund == "tímarit" then raw_tegund = "timarit" end
if raw_tegund == "bókarkafli" then raw_tegund = "bok" end
d.tegund = raw_tegund
-- Core & Roles
d.mainauthor = get_arg(args, 'aðalhöfundur', suffix) or get_arg(args, 'mainauthor', suffix)
d.authors = get_arg(args, 'höfundur', suffix) or get_arg(args, 'author', suffix)
if d.authors then d.authors = format_names(d.authors) end
d.editors = format_names(get_arg(args, 'ritstjóri', suffix) or get_arg(args, 'editor', suffix))
-- Date & Titles
d.year = get_arg(args, 'dags', suffix) or get_arg(args, 'ár', suffix) or get_arg(args, 'year', suffix)
d.title = get_arg(args, 'titill', suffix) or get_arg(args, 'title', suffix)
d.chapter = get_arg(args, 'kafli', suffix) or get_arg(args, 'chapter', suffix)
-- Containers
d.container = get_arg(args, 'tímarit', suffix) or get_arg(args, 'journal', suffix) or get_arg(args, 'albúm', suffix) or get_arg(args, 'album', suffix)
-- Locators & Positions
d.volume = get_arg(args, 'árgangur', suffix) or get_arg(args, 'volume', suffix)
d.issue = get_arg(args, 'tölublað', suffix) or get_arg(args, 'issue', suffix)
d.pages = get_arg(args, 'síður', suffix) or get_arg(args, 'síða', suffix) or get_arg(args, 'pages', suffix)
-- Publication Info
d.location = get_arg(args, 'útgáfustaður', suffix) or get_arg(args, 'location', suffix)
d.publisher = get_arg(args, 'útgefandi', suffix) or get_arg(args, 'publisher', suffix)
-- Identifiers & URLs
d.doi = get_arg(args, 'doi', suffix)
d.isbn = get_arg(args, 'isbn', suffix)
d.issn = get_arg(args, 'issn', suffix)
d.url = get_arg(args, 'vefslóð', suffix) or get_arg(args, 'url', suffix)
d.access = get_arg(args, 'sótt', suffix) or get_arg(args, 'access-date', suffix)
d.note = get_arg(args, 'athugasemd', suffix) or get_arg(args, 'note', suffix)
d.is_empty = not (d.authors or d.year or d.title or d.container or d.publisher or d.url)
return d
end
-- BUILDER (Flexible Type-Aware Wiktionary Citation Style)
local function build_citation(d, is_part2)
local tegund = d.tegund or "vef"
local auth_date = ""
-- 1. Author and Date construction
local auth = d.authors or (d.mainauthor and format_names(d.mainauthor))
if auth then
if d.year then
auth_date = auth .. " (" .. d.year .. ")"
else
auth_date = auth
end
else
if d.year then
auth_date = "(" .. d.year .. ")"
end
end
local body_parts = {}
if tegund == "bok" or tegund == "bók" then
-- Book format: Editor position handled correctly right after author / before book container
if d.chapter then
table.insert(body_parts, format_field(d.chapter, "quotes"))
local container_parts = {}
if d.editors then
table.insert(container_parts, d.editors .. ", ritstj.")
end
if d.title then
table.insert(container_parts, format_field(d.title, "italic"))
end
if #container_parts > 0 then
table.insert(body_parts, "í " .. table.concat(container_parts, ", "))
end
else
if d.editors then
table.insert(body_parts, d.editors .. ", ritstj.")
end
if d.title then
table.insert(body_parts, format_field(d.title, "italic"))
end
end
local pub_parts = {}
if d.location and d.publisher then
table.insert(pub_parts, d.location .. ": " .. d.publisher)
elseif d.publisher then
table.insert(pub_parts, d.publisher)
elseif d.location then
table.insert(pub_parts, d.location)
end
if #pub_parts > 0 then
table.insert(body_parts, table.concat(pub_parts, ", "))
end
if d.pages then
table.insert(body_parts, d.pages)
end
elseif tegund == "timarit" or tegund == "tímarit" then
-- Journal format: Author (Year). Title. í Journal, volume, issue, pages.
if d.chapter then
table.insert(body_parts, format_field(d.chapter, "quotes"))
elseif d.title then
table.insert(body_parts, format_field(d.title, "quotes"))
end
local container_parts = {}
if d.editors then
table.insert(container_parts, d.editors .. ", ritstj.")
end
if d.container then
table.insert(container_parts, format_field(d.container, "italic"))
end
if #container_parts > 0 then
table.insert(body_parts, "í " .. table.concat(container_parts, ", "))
end
local loc_parts = {}
if d.volume then table.insert(loc_parts, d.volume .. ". árgangur") end
if d.issue then table.insert(loc_parts, d.issue .. ". tölublað") end
local pub_str = ""
if d.location and d.publisher then
pub_str = d.location .. ": " .. d.publisher
elseif d.publisher then
pub_str = d.publisher
elseif d.location then
pub_str = d.location
end
if pub_str ~= "" then table.insert(loc_parts, pub_str) end
if d.pages then table.insert(loc_parts, d.pages) end
if #loc_parts > 0 then
table.insert(body_parts, table.concat(loc_parts, ", "))
end
else
-- Website / Default format (`vef`)
if d.chapter then
table.insert(body_parts, format_field(d.chapter, "quotes"))
elseif d.title then
table.insert(body_parts, format_field(d.title, "quotes"))
end
if d.container then
table.insert(body_parts, format_field(d.container, "italic"))
end
if d.pages then
table.insert(body_parts, d.pages)
end
end
-- Identifiers & URLs & Notes
local ids = {}
if d.doi then table.insert(ids, "DOI: " .. d.doi) end
if d.isbn then table.insert(ids, "ISBN " .. d.isbn) end
if d.issn then table.insert(ids, "ISSN " .. d.issn) end
if d.url then
if d.access then table.insert(ids, "sótt " .. d.access .. " af " .. d.url)
else table.insert(ids, d.url) end
end
if #ids > 0 then
table.insert(body_parts, table.concat(ids, ", "))
end
if d.note then
table.insert(body_parts, "(" .. d.note .. ")")
end
-- Assemble final citation string
local final_parts = {}
if auth_date ~= "" then
table.insert(final_parts, auth_date)
end
if #body_parts > 0 then
table.insert(final_parts, table.concat(body_parts, ", "))
end
return table.concat(final_parts, ", ")
end
function p.tilvisun(frame)
local args = frame:getParent().args
if not args['höfundur'] and not args['titill'] and not args['author'] then
args = frame.args
end
local d1 = extract_data(args, "")
local d2 = extract_data(args, "-2")
local final_str = ""
if not d1.is_empty then
final_str = build_citation(d1, false)
end
if not d2.is_empty then
local p2_str = build_citation(d2, true)
local tenging = get_arg(args, 'tenging', "") or "þýtt sem"
if final_str ~= "" then
final_str = final_str .. "; " .. tenging .. " " .. p2_str
else
final_str = p2_str
end
end
return final_str
end
return p
ip7nwmwgyj5o9crztlguvm91wzce671
392459
392450
2026-08-30T11:24:35Z
Ow! That Hurts!
8952
392459
Scribunto
text/plain
local p = {}
local metadata = mw.loadData('Module:tilvísun/data')
-- Helper: Fetch argument, checking aliases natively, allowing for suffix (-2)
local function get_arg(args, key, suffix)
suffix = suffix or ""
local val = args[key .. suffix]
if not val or val == "" then
for alias, standard_key in pairs(metadata.aliases) do
if standard_key == key then
local alias_key = alias .. suffix
if args[alias_key] and args[alias_key] ~= "" then
val = args[alias_key]
break
end
end
end
end
if val and val ~= "" then return mw.text.trim(val) end
return nil
end
-- Helper: Parse inline translations like <þ:Dagarnar> and apply style correctly
-- Ensures brackets are NOT italicized, while translation text italicizes when the base text does.
local function format_field(text, style)
if not text or text == "" then return nil end
local trans = string.match(text, "<þ:(.-)>")
local base = text
if trans then
base = string.gsub(text, "%s*<þ:.->", "")
end
base = mw.text.trim(base)
trans = trans and mw.text.trim(trans) or nil
if style == "quotes" then
local inner = base
if trans then inner = inner .. " [" .. trans .. "]" end
return "„" .. inner .. "“"
elseif style == "italic" then
local styled_base = "''" .. base .. "''"
if trans then
return styled_base .. " [''" .. trans .. "'']"
end
return styled_base
else
if trans then
return base .. " [" .. trans .. "]"
end
return base
end
end
-- Helper: Small Caps HTML wrapper
local function small_caps(text)
if not text or text == "" then return "" end
return '<span style="font-variant: small-caps;">' .. text .. '</span>'
end
-- Helper: Format semicolon-separated names with "og"
local function format_names(name_str)
if not name_str then return nil end
local names = {}
for name in string.gmatch(name_str, "([^;]+)") do
table.insert(names, small_caps(mw.text.trim(name)))
end
if #names == 0 then return nil end
local result_str = names[1]
if #names == 2 then result_str = names[1] .. " og " .. names[2]
elseif #names > 2 then
result_str = ""
for j = 1, #names do
if j == 1 then result_str = names[j]
elseif j == #names then result_str = result_str .. ", og " .. names[j]
else result_str = result_str .. ", " .. names[j] end
end
end
return result_str
end
-- DATA EXTRACTOR
local function extract_data(args, suffix)
local d = {}
local raw_tegund = get_arg(args, 'tegund', suffix) or get_arg(args, 'type', suffix) or "vef"
raw_tegund = mw.ustring.lower(raw_tegund)
if raw_tegund == "bók" then raw_tegund = "bok" end
if raw_tegund == "tímarit" then raw_tegund = "timarit" end
if raw_tegund == "bókarkafli" then raw_tegund = "bok" end
d.tegund = raw_tegund
-- Core & Roles
d.mainauthor = get_arg(args, 'aðalhöfundur', suffix) or get_arg(args, 'mainauthor', suffix)
d.authors = get_arg(args, 'höfundur', suffix) or get_arg(args, 'author', suffix)
if d.authors then d.authors = format_names(d.authors) end
d.editors = format_names(get_arg(args, 'ritstjóri', suffix) or get_arg(args, 'editor', suffix))
-- Date & Titles
d.year = get_arg(args, 'dags', suffix) or get_arg(args, 'ár', suffix) or get_arg(args, 'year', suffix)
d.title = get_arg(args, 'titill', suffix) or get_arg(args, 'title', suffix)
d.chapter = get_arg(args, 'kafli', suffix) or get_arg(args, 'chapter', suffix)
-- Containers
d.container = get_arg(args, 'tímarit', suffix) or get_arg(args, 'journal', suffix) or get_arg(args, 'albúm', suffix) or get_arg(args, 'album', suffix)
-- Locators & Positions
d.volume = get_arg(args, 'árgangur', suffix) or get_arg(args, 'volume', suffix)
d.issue = get_arg(args, 'tölublað', suffix) or get_arg(args, 'issue', suffix)
d.pages = get_arg(args, 'síður', suffix) or get_arg(args, 'síða', suffix) or get_arg(args, 'pages', suffix)
-- Publication Info
d.location = get_arg(args, 'útgáfustaður', suffix) or get_arg(args, 'location', suffix)
d.publisher = get_arg(args, 'útgefandi', suffix) or get_arg(args, 'publisher', suffix)
-- Identifiers & URLs
d.doi = get_arg(args, 'doi', suffix)
d.isbn = get_arg(args, 'isbn', suffix)
d.issn = get_arg(args, 'issn', suffix)
d.url = get_arg(args, 'vefslóð', suffix) or get_arg(args, 'url', suffix)
d.access = get_arg(args, 'sótt', suffix) or get_arg(args, 'access-date', suffix)
d.note = get_arg(args, 'athugasemd', suffix) or get_arg(args, 'note', suffix)
d.is_empty = not (d.authors or d.year or d.title or d.container or d.publisher or d.url)
return d
end
-- BUILDER (Flexible Type-Aware Wiktionary Citation Style)
local function build_citation(d, is_part2)
local tegund = d.tegund or "vef"
local auth_date = ""
-- 1. Author and Date construction
local auth = d.authors or (d.mainauthor and format_names(d.mainauthor))
if auth then
if d.year then
auth_date = auth .. " (" .. d.year .. ")"
else
auth_date = auth
end
else
if d.year then
auth_date = "(" .. d.year .. ")"
end
end
local body_parts = {}
if tegund == "bok" or tegund == "bók" then
if d.chapter then
table.insert(body_parts, format_field(d.chapter, "quotes"))
local container_parts = {}
if d.editors then
table.insert(container_parts, d.editors .. ", ritstj.")
end
if d.title then
table.insert(container_parts, format_field(d.title, "italic"))
end
if #container_parts > 0 then
table.insert(body_parts, "í " .. table.concat(container_parts, ", "))
end
else
if d.editors then
table.insert(body_parts, d.editors .. ", ritstj.")
end
if d.title then
table.insert(body_parts, format_field(d.title, "italic"))
end
end
local pub_parts = {}
if d.location and d.publisher then
table.insert(pub_parts, d.location .. ": " .. d.publisher)
elseif d.publisher then
table.insert(pub_parts, d.publisher)
elseif d.location then
table.insert(pub_parts, d.location)
end
if #pub_parts > 0 then
table.insert(body_parts, table.concat(pub_parts, ", "))
end
if d.pages then
table.insert(body_parts, d.pages)
end
elseif tegund == "timarit" or tegund == "tímarit" then
if d.chapter then
table.insert(body_parts, format_field(d.chapter, "quotes"))
elseif d.title then
table.insert(body_parts, format_field(d.title, "quotes"))
end
local container_parts = {}
if d.editors then
table.insert(container_parts, d.editors .. ", ritstj.")
end
if d.container then
table.insert(container_parts, format_field(d.container, "italic"))
end
if #container_parts > 0 then
table.insert(body_parts, "í " .. table.concat(container_parts, ", "))
end
local loc_parts = {}
if d.volume then table.insert(loc_parts, d.volume .. ". árgangur") end
if d.issue then table.insert(loc_parts, d.issue .. ". tölublað") end
local pub_str = ""
if d.location and d.publisher then
pub_str = d.location .. ": " .. d.publisher
elseif d.publisher then
pub_str = d.publisher
elseif d.location then
pub_str = d.location
end
if pub_str ~= "" then table.insert(loc_parts, pub_str) end
if d.pages then table.insert(loc_parts, d.pages) end
if #loc_parts > 0 then
table.insert(body_parts, table.concat(loc_parts, ", "))
end
else
if d.chapter then
table.insert(body_parts, format_field(d.chapter, "quotes"))
elseif d.title then
table.insert(body_parts, format_field(d.title, "quotes"))
end
if d.container then
table.insert(body_parts, format_field(d.container, "italic"))
end
if d.pages then
table.insert(body_parts, d.pages)
end
end
-- Identifiers & URLs & Notes
local ids = {}
if d.doi then table.insert(ids, "DOI: " .. d.doi) end
if d.isbn then table.insert(ids, "ISBN " .. d.isbn) end
if d.issn then table.insert(ids, "ISSN " .. d.issn) end
if d.url then
if d.access then table.insert(ids, "sótt " .. d.access .. " af " .. d.url)
else table.insert(ids, d.url) end
end
if #ids > 0 then
table.insert(body_parts, table.concat(ids, ", "))
end
if d.note then
table.insert(body_parts, "(" .. d.note .. ")")
end
-- Assemble final citation string
local final_parts = {}
if auth_date ~= "" then
table.insert(final_parts, auth_date)
end
if #body_parts > 0 then
table.insert(final_parts, table.concat(body_parts, ", "))
end
return table.concat(final_parts, ", ")
end
function p.tilvisun(frame)
local args = frame:getParent().args
if not args['höfundur'] and not args['titill'] and not args['author'] then
args = frame.args
end
local d1 = extract_data(args, "")
local d2 = extract_data(args, "-2")
local final_str = ""
if not d1.is_empty then
final_str = build_citation(d1, false)
end
if not d2.is_empty then
local p2_str = build_citation(d2, true)
local tenging = get_arg(args, 'tenging', "") or "þýtt sem"
if final_str ~= "" then
final_str = final_str .. "; " .. tenging .. " " .. p2_str
else
final_str = p2_str
end
end
return final_str
end
return p
6ev68vf5lm4163cl3bwx1clicvp04a5
392460
392459
2026-08-30T11:31:45Z
Ow! That Hurts!
8952
392460
Scribunto
text/plain
local p = {}
local metadata = mw.loadData('Module:tilvísun/data')
-- Helper: Fetch argument, checking aliases natively, allowing for suffix (-2)
local function get_arg(args, key, suffix)
suffix = suffix or ""
local val = args[key .. suffix]
if not val or val == "" then
for alias, standard_key in pairs(metadata.aliases) do
if standard_key == key then
local alias_key = alias .. suffix
if args[alias_key] and args[alias_key] ~= "" then
val = args[alias_key]
break
end
end
end
end
if val and val ~= "" then return mw.text.trim(val) end
return nil
end
-- Helper: Parse inline translations like <þ:Dagarnar> and apply style correctly
-- Ensures brackets are NOT italicized, while translation text italicizes when the base text does.
local function format_field(text, style)
if not text or text == "" then return nil end
local trans = string.match(text, "<þ:(.-)>")
local base = text
if trans then
base = string.gsub(text, "%s*<þ:.->", "")
end
base = mw.text.trim(base)
trans = trans and mw.text.trim(trans) or nil
if style == "quotes" then
local inner = base
if trans then inner = inner .. " [" .. trans .. "]" end
return "„" .. inner .. "“"
elseif style == "italic" then
local styled_base = "''" .. base .. "''"
if trans then
return styled_base .. " [''" .. trans .. "'']"
end
return styled_base
else
if trans then
return base .. " [" .. trans .. "]"
end
return base
end
end
-- Helper: Small Caps HTML wrapper
local function small_caps(text)
if not text or text == "" then return "" end
return '<span style="font-variant: small-caps;">' .. text .. '</span>'
end
-- Helper: Extract the last name (surname) from an editor name string
local function get_last_name(name_str)
if not name_str then return nil end
local first_name = mw.text.split(name_str, ";")[1]
first_name = mw.text.trim(first_name)
local words = {}
for word in string.gmatch(first_name, "%S+") do
table.insert(words, word)
end
if #words > 0 then
return words[#words]
end
return first_name
end
-- Helper: Format semicolon-separated names with "og"
local function format_names(name_str)
if not name_str then return nil end
local names = {}
for name in string.gmatch(name_str, "([^;]+)") do
table.insert(names, small_caps(mw.text.trim(name)))
end
if #names == 0 then return nil end
local result_str = names[1]
if #names == 2 then result_str = names[1] .. " og " .. names[2]
elseif #names > 2 then
result_str = ""
for j = 1, #names do
if j == 1 then result_str = names[j]
elseif j == #names then result_str = result_str .. ", og " .. names[j]
else result_str = result_str .. ", " .. names[j] end
end
end
return result_str
end
-- DATA EXTRACTOR
local function extract_data(args, suffix)
local d = {}
local raw_tegund = get_arg(args, 'tegund', suffix) or get_arg(args, 'type', suffix) or "vef"
raw_tegund = mw.ustring.lower(raw_tegund)
if raw_tegund == "bók" then raw_tegund = "bok" end
if raw_tegund == "tímarit" then raw_tegund = "timarit" end
if raw_tegund == "bókarkafli" then raw_tegund = "bok" end
d.tegund = raw_tegund
-- Core & Roles
d.mainauthor = get_arg(args, 'aðalhöfundur', suffix) or get_arg(args, 'mainauthor', suffix)
d.authors = get_arg(args, 'höfundur', suffix) or get_arg(args, 'author', suffix)
if d.authors then d.authors = format_names(d.authors) end
d.raw_editor = get_arg(args, 'ritstjóri', suffix) or get_arg(args, 'editor', suffix)
d.editors = format_names(d.raw_editor)
-- Date & Titles
d.year = get_arg(args, 'dags', suffix) or get_arg(args, 'ár', suffix) or get_arg(args, 'year', suffix)
d.title = get_arg(args, 'titill', suffix) or get_arg(args, 'title', suffix)
d.chapter = get_arg(args, 'kafli', suffix) or get_arg(args, 'chapter', suffix)
-- Containers
d.container = get_arg(args, 'tímarit', suffix) or get_arg(args, 'journal', suffix) or get_arg(args, 'albúm', suffix) or get_arg(args, 'album', suffix)
-- Locators & Positions
d.volume = get_arg(args, 'árgangur', suffix) or get_arg(args, 'volume', suffix)
d.issue = get_arg(args, 'tölublað', suffix) or get_arg(args, 'issue', suffix)
d.pages = get_arg(args, 'síður', suffix) or get_arg(args, 'síða', suffix) or get_arg(args, 'pages', suffix)
-- Publication Info
d.location = get_arg(args, 'útgáfustaður', suffix) or get_arg(args, 'location', suffix)
d.publisher = get_arg(args, 'útgefandi', suffix) or get_arg(args, 'publisher', suffix)
-- Identifiers & URLs
d.doi = get_arg(args, 'doi', suffix)
d.isbn = get_arg(args, 'isbn', suffix)
d.issn = get_arg(args, 'issn', suffix)
d.url = get_arg(args, 'vefslóð', suffix) or get_arg(args, 'url', suffix)
d.access = get_arg(args, 'sótt', suffix) or get_arg(args, 'access-date', suffix)
d.note = get_arg(args, 'athugasemd', suffix) or get_arg(args, 'note', suffix)
d.is_empty = not (d.authors or d.raw_editor or d.year or d.title or d.container or d.publisher or d.url)
return d
end
-- BUILDER (Flexible Type-Aware Wiktionary Citation Style)
local function build_citation(d, is_part2)
local tegund = d.tegund or "vef"
local auth_date = ""
-- 1. Author and Date construction (Fallback to editor's last name if höfundur is missing)
local auth = d.authors or (d.mainauthor and format_names(d.mainauthor))
local editor_as_author = false
if not auth and d.raw_editor then
local last_name = get_last_name(d.raw_editor)
if last_name then
auth = small_caps(last_name)
editor_as_author = true
end
end
if auth then
if d.year and not is_part2 then
auth_date = auth .. " (" .. d.year .. ")"
else
auth_date = auth
end
else
if d.year and not is_part2 then
auth_date = "(" .. d.year .. ")"
end
end
local body_parts = {}
if tegund == "bok" or tegund == "bók" then
if d.chapter then
table.insert(body_parts, format_field(d.chapter, "quotes"))
local container_parts = {}
if d.editors then
table.insert(container_parts, d.editors .. ", ritstj.")
end
if d.title then
table.insert(container_parts, format_field(d.title, "italic"))
end
if #container_parts > 0 then
table.insert(body_parts, "í " .. table.concat(container_parts, ", "))
end
else
if d.editors and not editor_as_author then
table.insert(body_parts, d.editors .. ", ritstj.")
end
if d.title then
table.insert(body_parts, format_field(d.title, "italic"))
end
end
local pub_parts = {}
if d.location and d.publisher then
table.insert(pub_parts, d.location .. ": " .. d.publisher)
elseif d.publisher then
table.insert(pub_parts, d.publisher)
elseif d.location then
table.insert(pub_parts, d.location)
end
if #pub_parts > 0 then
table.insert(body_parts, table.concat(pub_parts, ", "))
end
if is_part2 and d.year then
table.insert(body_parts, d.year)
end
if d.pages then
table.insert(body_parts, d.pages)
end
elseif tegund == "timarit" or tegund == "tímarit" then
if d.chapter then
table.insert(body_parts, format_field(d.chapter, "quotes"))
elseif d.title then
table.insert(body_parts, format_field(d.title, "quotes"))
end
local container_parts = {}
if d.editors and not editor_as_author then
table.insert(container_parts, d.editors .. ", ritstj.")
end
if d.container then
table.insert(container_parts, format_field(d.container, "italic"))
end
if #container_parts > 0 then
table.insert(body_parts, "í " .. table.concat(container_parts, ", "))
end
local loc_parts = {}
if d.volume then table.insert(loc_parts, d.volume .. ". árgangur") end
if d.issue then table.insert(loc_parts, d.issue .. ". tölublað") end
local pub_str = ""
if d.location and d.publisher then
pub_str = d.location .. ": " .. d.publisher
elseif d.publisher then
pub_str = d.publisher
elseif d.location then
pub_str = d.location
end
if pub_str ~= "" then table.insert(loc_parts, pub_str) end
if is_part2 and d.year then
table.insert(loc_parts, d.year)
end
if d.pages then table.insert(loc_parts, d.pages) end
if #loc_parts > 0 then
table.insert(body_parts, table.concat(loc_parts, ", "))
end
else
if d.chapter then
table.insert(body_parts, format_field(d.chapter, "quotes"))
elseif d.title then
table.insert(body_parts, format_field(d.title, "quotes"))
end
if d.container then
table.insert(body_parts, format_field(d.container, "italic"))
end
if is_part2 and d.year then
table.insert(body_parts, d.year)
end
if d.pages then
table.insert(body_parts, d.pages)
end
end
-- Identifiers & URLs & Notes
local ids = {}
if d.doi then table.insert(ids, "DOI: " .. d.doi) end
if d.isbn then table.insert(ids, "ISBN " .. d.isbn) end
if d.issn then table.insert(ids, "ISSN " .. d.issn) end
if d.url then
if d.access then table.insert(ids, "sótt " .. d.access .. " af " .. d.url)
else table.insert(ids, d.url) end
end
if #ids > 0 then
table.insert(body_parts, table.concat(ids, ", "))
end
if d.note then
table.insert(body_parts, "(" .. d.note .. ")")
end
-- Assemble final citation string
local final_parts = {}
if auth_date ~= "" then
table.insert(final_parts, auth_date)
end
if #body_parts > 0 then
table.insert(final_parts, table.concat(body_parts, ", "))
end
return table.concat(final_parts, ", ")
end
function p.tilvisun(frame)
local args = frame:getParent().args
if not args['höfundur'] and not args['ritstjóri'] and not args['titill'] and not args['author'] and not args['editor'] then
args = frame.args
end
local d1 = extract_data(args, "")
local d2 = extract_data(args, "-2")
local final_str = ""
if not d1.is_empty then
final_str = build_citation(d1, false)
end
if not d2.is_empty then
local p2_str = build_citation(d2, true)
local tenging = get_arg(args, 'tenging', "") or "þýtt sem"
if final_str ~= "" then
final_str = final_str .. "; " .. tenging .. " " .. p2_str
else
final_str = p2_str
end
end
return final_str
end
return p
q8fyny928j5tbe142bwwahe14dxtkyl
Module:tilvísun/data
828
118919
392435
2026-08-30T00:14:31Z
Ow! That Hurts!
8952
Bjó til síðu með „local data = {} -- Define how different media types format their titles and containers data.format_rules = { bok = { title_style = "italic", container_style = "none" }, timarit = { title_style = "plain", container_style = "italic" }, grein = { title_style = "quotes", container_style = "italic" }, vef = { title_style = "italic", container_style = "plain" }, myndband = { title_style = "italic", container_style = "none" }, lag = { title_style...“
392435
Scribunto
text/plain
local data = {}
-- Define how different media types format their titles and containers
data.format_rules = {
bok = { title_style = "italic", container_style = "none" },
timarit = { title_style = "plain", container_style = "italic" },
grein = { title_style = "quotes", container_style = "italic" },
vef = { title_style = "italic", container_style = "plain" },
myndband = { title_style = "italic", container_style = "none" },
lag = { title_style = "quotes", container_style = "italic" }
}
-- Map alternative names and English fallbacks to standard variables
data.aliases = {
["author"] = "höfundur",
["year"] = "ár",
["date"] = "dags",
["title"] = "titill",
["trans-title"] = "þýðing_titils",
["journal"] = "tímarit",
["volume"] = "árgangur",
["issue"] = "tölublað",
["pages"] = "síður",
["publisher"] = "útgefandi",
["location"] = "útgáfustaður",
["url"] = "vefslóð",
["access-date"] = "sótt"
}
return data
qg82e5xreziswf8pquagg9iiuz0hma3
Snið:stil
10
118920
392445
2026-08-30T09:37:32Z
Ow! That Hurts!
8952
skapað
392445
wikitext
text/x-wiki
{{stutt tilvitnun|{{#invoke:slembitölugjafi|main}}|{{{1}}}|{{{2}}}}}<noinclude>
stytt útgáfa af sniðmátinu <code><nowiki>{{stutt tilvitnun}}</nowiki></code> sem krefst ekki fyrstu breytunnar
</noinclude>
jcxfpn9qbhvgft86a1u4i73gqclgo1v
Snið:tilvísun
10
118921
392451
2026-08-30T10:39:07Z
Ow! That Hurts!
8952
Bjó til síðu með „{{#invoke:tilvísun|tilvisun}}<noinclude> tegund= (bok / bók, timarit / tímarit, or default web/vef) tenging= (þýtt sem) höfundur= aðalhöfundur= ritstjóri= titill= kafli= ár= dags= útgefandi= útgáfustaður= tímarit= árgangur= tölublað= síður= doi= isbn= issn= vefslóð= sótt= athugasemd=</noinclude>“
392451
wikitext
text/x-wiki
{{#invoke:tilvísun|tilvisun}}<noinclude>
tegund= (bok / bók, timarit / tímarit, or default web/vef)
tenging= (þýtt sem)
höfundur=
aðalhöfundur=
ritstjóri=
titill=
kafli=
ár=
dags=
útgefandi=
útgáfustaður=
tímarit=
árgangur=
tölublað=
síður=
doi=
isbn=
issn=
vefslóð=
sótt=
athugasemd=</noinclude>
qzht5uxcea4oe44bbn7mhdgogjqjvgg
Module:tilvitnun-stil
828
118922
392452
2026-08-30T10:57:42Z
Ow! That Hurts!
8952
Bjó til síðu með „local p = {} local tilvisun = require('Module:tilvísun') local function getLastWord(s) if not s or s == "" then return "" end s = mw.text.trim(s) local words = {} for word in s:gmatch("%S+") do table.insert(words, word) end return words[#words] or "" end -- Short citation style with override support function p.short(frame) local args = frame.args local parentArgs = frame:getParent() and frame:getParent().args or {} lo...“
392452
Scribunto
text/plain
local p = {}
local tilvisun = require('Module:tilvísun')
local function getLastWord(s)
if not s or s == "" then return "" end
s = mw.text.trim(s)
local words = {}
for word in s:gmatch("%S+") do
table.insert(words, word)
end
return words[#words] or ""
end
-- Short citation style with override support
function p.short(frame)
local args = frame.args
local parentArgs = frame:getParent() and frame:getParent().args or {}
local combinedArgs = {}
for k, v in pairs(parentArgs) do combinedArgs[k] = v end
for k, v in pairs(args) do combinedArgs[k] = v end
-- Use ASCII variable names to prevent Lua syntax errors
local lastname = combinedArgs["nafn"] or combinedArgs["hof_override"]
if not lastname or lastname == "" then
local hofundur = combinedArgs["höfundur"] or combinedArgs["höf"] or ""
lastname = getLastWord(hofundur)
end
local year = combinedArgs["ar_override"]
if not year or year == "" then
local ar_or_dags = combinedArgs["ár"] or combinedArgs["dags"] or ""
year = getLastWord(ar_or_dags)
end
local content = ""
if lastname ~= "" then
local smallcaps_author = string.format('<span style="font-variant: small-caps;">%s</span>,', lastname)
if year ~= "" then
content = string.format("%s %s", smallcaps_author, year)
else
content = smallcaps_author
end
else
content = year
end
return mw.getCurrentFrame():expandTemplate{
title = 'stil',
args = { [1] = content, mode = "1" }
}
end
-- Standard citation style using Module:tilvísun
function p.standard(frame)
local args = frame.args
local parentArgs = frame:getParent() and frame:getParent().args or {}
local combinedArgs = {}
for k, v in pairs(parentArgs) do combinedArgs[k] = v end
for k, v in pairs(args) do combinedArgs[k] = v end
local content = ""
local status, res = pcall(function()
if type(tilvisun.main) == "function" then
local mockFrame = {
args = combinedArgs,
getParent = function() return { args = combinedArgs } end
}
return tilvisun.main(mockFrame)
else
error("Module:tilvísun has no main function")
end
end)
if status and res then
content = res
else
content = mw.getCurrentFrame():expandTemplate{ title = 'tilvísun', args = combinedArgs }
end
return mw.getCurrentFrame():expandTemplate{
title = 'stil',
args = { [1] = content, mode = "2" }
}
end
-- Main entry point
function p.main(frame)
local args = frame.args
local parentArgs = frame:getParent() and frame:getParent().args or {}
local combinedArgs = {}
for k, v in pairs(parentArgs) do combinedArgs[k] = v end
for k, v in pairs(args) do combinedArgs[k] = v end
local mode = combinedArgs[1] or args[1] or "2"
if mode == "1" then
return p.short(frame)
else
return p.standard(frame)
end
end
return p
alp2kf8nn7pz9dlas4gy86lh5tytyxm
392453
392452
2026-08-30T11:03:49Z
Ow! That Hurts!
8952
392453
Scribunto
text/plain
local p = {}
local tilvisun = require('Module:tilvísun')
local function getLastWord(s)
if not s or s == "" then return "" end
s = mw.text.trim(s)
local words = {}
for word in s:gmatch("%S+") do
table.insert(words, word)
end
return words[#words] or ""
end
function p.main(frame)
local args = frame.args
local parentArgs = frame:getParent() and frame:getParent().args or {}
local combinedArgs = {}
for k, v in pairs(parentArgs) do combinedArgs[k] = v end
for k, v in pairs(args) do combinedArgs[k] = v end
-- 1. Generate the full citation using Module:tilvísun (passed into {{{2}}} of {{stil}})
local full_citation = ""
local status, res = pcall(function()
if type(tilvisun.main) == "function" then
local mockFrame = {
args = combinedArgs,
getParent = function() return { args = combinedArgs } end
}
return tilvisun.main(mockFrame)
else
error("Module:tilvísun has no main function")
end
end)
if status and res then
full_citation = res
else
-- Fallback to template expansion if direct module call fails
full_citation = mw.getCurrentFrame():expandTemplate{ title = 'tilvísun', args = combinedArgs }
end
-- 2. Generate the short citation (passed into {{{1}}} of {{stil}})
-- Support overrides: 'nafn' or 'höf_override' for author last name
local lastname = combinedArgs["nafn"] or combinedArgs["höf_hnekkja"] or combinedArgs["hof_hnekkja"]
if not lastname or lastname == "" then
local hofundur = combinedArgs["höfundur"] or combinedArgs["höf"] or ""
lastname = getLastWord(hofundur)
end
-- Support override: 'ár_override' for year
local year = combinedArgs["ár_hnekkja"] or combinedArgs["ar_hnekkja"]
if not year or year == "" then
local ar_or_dags = combinedArgs["ár"] or combinedArgs["dags"] or ""
year = getLastWord(ar_or_dags)
end
local short_citation = ""
if lastname ~= "" then
local smallcaps_author = string.format('<span style="font-variant: small-caps;">%s</span>', lastname)
if year ~= "" then
short_citation = string.format("%s, %s", smallcaps_author, year)
else
short_citation = smallcaps_author
end
else
short_citation = year
end
-- 3. Wrap both into the {{stil}} template as parameters {{{1}}} and {{{2}}}
return mw.getCurrentFrame():expandTemplate{
title = 'stil',
args = {
[1] = short_citation,
[2] = full_citation
}
}
end
return p
poyq349za7my5h4tt0gu8gr3pm8r6rv
392455
392453
2026-08-30T11:09:32Z
Ow! That Hurts!
8952
392455
Scribunto
text/plain
local p = {}
local tilvisun = require('Module:tilvísun')
local function getLastWord(s)
if not s or s == "" then return "" end
s = mw.text.trim(s)
local words = {}
for word in s:gmatch("%S+") do
table.insert(words, word)
end
return words[#words] or ""
end
function p.main(frame)
local args = frame.args
local parentArgs = frame:getParent() and frame:getParent().args or {}
local combinedArgs = {}
for k, v in pairs(parentArgs) do combinedArgs[k] = v end
for k, v in pairs(args) do combinedArgs[k] = v end
-- 1. Generate the full citation using Module:tilvísun (passed into {{{2}}} of {{stil}})
local full_citation = ""
local status, res = pcall(function()
if type(tilvisun.main) == "function" then
local mockFrame = {
args = combinedArgs,
getParent = function() return { args = combinedArgs } end
}
return tilvisun.main(mockFrame)
else
error("Module:tilvísun has no main function")
end
end)
if status and res then
full_citation = res
else
-- Fallback to template expansion if direct module call fails
full_citation = mw.getCurrentFrame():expandTemplate{ title = 'tilvísun', args = combinedArgs }
end
-- 2. Generate the short citation (passed into {{{1}}} of {{stil}})
-- Support overrides: 'nafn' or 'höf_override' for author last name
local lastname = combinedArgs["nafn"] or combinedArgs["höf-hnekkja"] or combinedArgs["hof-hnekkja"]
if not lastname or lastname == "" then
local hofundur = combinedArgs["höfundur"] or combinedArgs["höf"] or ""
lastname = getLastWord(hofundur)
end
-- Support override: 'ár_override' for year
local year = combinedArgs["ár-hnekkja"] or combinedArgs["ar-hnekkja"]
if not year or year == "" then
local ar_or_dags = combinedArgs["ár"] or combinedArgs["dags"] or ""
year = getLastWord(ar_or_dags)
end
local short_citation = ""
if lastname ~= "" then
local smallcaps_author = string.format('<span style="font-variant: small-caps;">%s</span>', lastname)
if year ~= "" then
short_citation = string.format("%s, %s", smallcaps_author, year)
else
short_citation = smallcaps_author
end
else
short_citation = year
end
-- 3. Wrap both into the {{stil}} template as parameters {{{1}}} and {{{2}}}
return mw.getCurrentFrame():expandTemplate{
title = 'stil',
args = {
[1] = short_citation,
[2] = full_citation
}
}
end
return p
9ec34okil7yztbcvelzb2my13l4ic2c
Snið:tilvitnun-stil
10
118923
392454
2026-08-30T11:04:44Z
Ow! That Hurts!
8952
Bjó til síðu með „{{#invoke:tilvitnun-stil|main}}<noinclude> </noinclude>“
392454
wikitext
text/x-wiki
{{#invoke:tilvitnun-stil|main}}<noinclude>
</noinclude>
4b4g1cob0kruosgvrxqqaf1rfoghykt