Module talk:Footnotes/anchor id list: Difference between revisions

Content deleted Content added
ce
 
(20 intermediate revisions by 3 users not shown)
Line 1:
'''This talk page has been usurped to be a testcases page for development. To talk about this module, please do so at [[Module talk:Footnotes]].'''
 
 
{{TOC right}}
There has always been a problem with the {{tlx|harv}} and {{tlx|sfn}} families of templates: except that every link that is created by these templates is tested at creation, editors don't know if the link works. A remedy for that has been user-scripts like [[User:Ucucha/HarvErrors]]. But, not all editors use that script so broken harv links can go undetected for a long time. At the moment, there is [[Wikipedia:Bots/Requests_for_approval/AntiCompositeBot|prospective bot]] that would mark broken-link harv templates by adding {{tlx|broken footnote}} after the broken-link harv template.
 
I have another possible solution. I have created a [[Module:Sandbox/trappist the monk/harv link test|lua module]] that extracts reference linking data from cs1|2 and vcite templates. I have modified [[Module:Footnotes/sandbox]] to use the extracted data to determine if:
:the harv template does not have a matching citation template
:more than one citation template matches the harv template
Line 251 ⟶ 254:
|}
 
==ref=<nowiki>{{sfnref}}</nowiki> and |ref=<nowiki>{{harvid}}</nowiki>==
{| class="wikitable" width="100%"
|+{{pipe}}ref={{tl|sfnref}} and {{pipe}}ref={{tl|harvid}}
Line 270 ⟶ 273:
| <code><nowiki>{{Cite book |title=Title |ref={{harvid|Blue|2020}}}}</nowiki></code> || {{Cite book |title=Title |ref={{harvid|Blue|2020}}}}
|-
! colspan="2" | {{tlf|Harvidharvid}}
|-
| <code><nowiki>{{Cite book |title=Title |ref={{Harvidharvid|Blue|Red|2020}}}}</nowiki></code> || {{Cite book |title=Title |ref={{Harvidharvid|Blue|Red|2020}}}}
|-
! colspan="2" | {{tlf|sfnref}}
Line 510 ⟶ 513:
|}
 
==cite LSAharvc ==
 
{| class="wikitable" width="100%"
|+harvc
|+{{tl|cite LSA}}
!template !! rendering
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|WhiteGeorge|2020Read|Johnson|Ferber|1957}}</nowiki></code> || {{Harvard citation no brackets/sandbox|WhiteGeorge|Read|Johnson|Ferber|20201957}}
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|Stefferud|1957|ref=CITEREFStefferud preface}}</nowiki></code> || {{Harvard citation no brackets/sandbox|Stefferud|1957|ref=CITEREFStefferud preface}}
! colspan="2" | CITEREF uses {{pipe}}last= and {{pipe}}year= always; {{pipe}}ref= not supported
|-
! colspan="2" | {{tl|harvc}} templates
| <code><nowiki>{{cite LSA |year=2020 |last=White |first=First |title=Title}}</nowiki></code> || {{cite LSA |year=2020 |last=White |first=First |title=Title}}
|-
| <code><nowiki>{{harvc/sandbox |last=George |first=Ernest J. |last2=Read |last3=Johnson |last4=Ferber |year=1957 |contribution=Shelterbelts and Windbreaks |url=//archive.org/stream/yoa1957#page/n785/mode/1up |in=Stefferud}}</nowiki></code> || {{harvc/sandbox |last=George |first=Ernest J. |last2=Read |last3=Johnson |last4=Ferber |year=1957 |contribution=Shelterbelts and Windbreaks |url=//archive.org/stream/yoa1957#page/n785/mode/1up |in=Stefferud}}
|-
| <code><nowiki>{{harvc/sandbox |last=Stefferud |first=A.|year=1957 |id=CITEREFStefferud preface |c=Preface |url=//archive.org/stream/yoa1957#page/n7/mode/1up |in=Stefferud}}</nowiki></code> || {{harvc/sandbox |last=Stefferud |first=A.|year=1957 |id=CITEREFStefferud preface |c=Preface |url=//archive.org/stream/yoa1957#page/n7/mode/1up |in=Stefferud}}
|-
! colspan="2" | cs1{{pipe}}2 templates
|-
|<code><nowiki>{{cite book |title=Soil: The Yearbook of Agriculture 1957 |editor-last=Stefferud |editor-first=Alfred |year=1957 |publisher=United States Department of Agriculture |url=//archive.org/stream/yoa1957#page/n2/mode/1up |oclc=704186906 |ref=harv}}</nowiki></code> || {{cite book |title=Soil: The Yearbook of Agriculture 1957 |editor-last=Stefferud |editor-first=Alfred |year=1957 |publisher=United States Department of Agriculture |url=//archive.org/stream/yoa1957#page/n2/mode/1up |oclc=704186906 |ref=harv}}
|}
 
{| class="wikitable" width="100%"
== vcite templates ==
|+harvc with {{pipe}}anchor-year=
!template !! rendering
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|Hunt |1995a}}</nowiki></code> || {{Harvard citation no brackets/sandbox|Hunt |1995a}}
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|Hunt |1995b}}</nowiki></code> || {{Harvard citation no brackets/sandbox|Hunt |1995b}}
|-
! colspan="2" | {{tl|harvc}} templates
|-
| <code><nowiki>{{harvc/sandbox |in=McMillan |in2=Horobin |last=Hunt |first=David |c=Appendix I Names and synonyms of the species, subspecies and interspecific hybrids |year=1995 |anchor-year=1995a |mode=cs2 |nb=yes}}</nowiki></code> || {{harvc/sandbox |in=McMillan |in2=Horobin |last=Hunt |first=David |c=Appendix I Names and synonyms of the species, subspecies and interspecific hybrids |year=1995 |anchor-year=1995a |mode=cs2 |nb=yes}}
|-
| <code><nowiki>{{harvc/sandbox |in=McMillan |in2=Horobin |last=Hunt |first=David |c=Appendix III Excerpts from a Brazilian diary |year=1995 |anchor-year=1995b |mode=cs2 |nb=yes}}</nowiki></code> || {{harvc/sandbox |in=McMillan |in2=Horobin |last=Hunt |first=David |c=Appendix III Excerpts from a Brazilian diary |year=1995 |anchor-year=1995b |mode=cs2 |nb=yes}}
|-
! colspan="2" | cs1{{pipe}}2 template
|-
|<code><nowiki>{{Citation |last=McMillan |first=A. J. S. |last2=Horobin |first2=J. F. |year=1995 |title=Christmas Cacti: The Genus ''Schlumbergera'' and Its Hybrids |edition=p/b |publication-place=Sherbourne, Dorset, UK |publisher=David Hunt |isbn=978-0-9517234-6-3}}</nowiki></code> || {{Citation |last=McMillan |first=A. J. S. |last2=Horobin |first2=J. F. |year=1995 |title=Christmas Cacti: The Genus ''Schlumbergera'' and Its Hybrids |edition=p/b |publication-place=Sherbourne, Dorset, UK |publisher=David Hunt |isbn=978-0-9517234-6-3}}
|}
 
== wikicite ==
 
{| class="wikitable" width="100%"
|+{{tl|wikicite}}
|+vcite templates
!template !! rendering
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|WhiteBailey|Black|20201979|ref=WhiteBlack2020Reference-idBailey1979}}</nowiki></code> || {{Harvard citation no brackets/sandbox|White|BlackBailey|20201979|ref=WhiteBlack2020Reference-idBailey1979}}
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|WhiteAnon.|Brown|2020n.d.(a)}}</nowiki></code> || {{Harvard citation no brackets/sandbox|White|BrownAnon.|2020n.d.(a)}}
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|WhiteAtwood|Red|20202003|ref=WhiteRed2020Reference-{{sfnref|Atwood|2003}}}}</nowiki></code> || {{Harvard citation no brackets/sandbox|WhiteAtwood|Red|20202003|ref=WhiteRed2020Reference-{{sfnref|Atwood|2003}}}}
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|Atwood|2003}}</nowiki></code> || {{Harvard citation no brackets/sandbox|Atwood|2003}}
! colspan="2" | using {{pipe}}ref=
|-
! colspan="2" | {{pipe}}id=
| <code><nowiki>{{vcite book |year=2020 |author=White, Black |title=Title |ref=WhiteBlack2020}}</nowiki></code> || {{vcite book |year=2020 |author=White, Black |title=Title |ref=WhiteBlack2020}}
|-
| <code><nowiki>{{wikicite|id=idBailey1979|reference=Bailey, John W. ''Pacifying the Plains: General Alfred Terry and the Decline of the Sioux, 1866–1890.'' Westport, Conn.: [[Greenwood Press]], 1979.}}</nowiki></code> || {{wikicite|id=idBailey1979|reference=Bailey, John W. ''Pacifying the Plains: General Alfred Terry and the Decline of the Sioux, 1866–1890.'' Westport, Conn.: [[Greenwood Press]], 1979.}}
! colspan="2" | using {{pipe}}harvid= (makes CITEREF...)
|-
! colspan="2" | {{pipe}}ref=
| <code><nowiki>{{vancite book |year=2020 |author=White, Brown |title=Title |harvid=WhiteBrown2020}}</nowiki></code> || {{vancite book |year=2020 |author=White, Brown |title=Title |harvid=WhiteBrown2020}}
|-
| <code><nowiki>{{wikicite|ref={{sfnref|Anon.|n.d.(a)}}|reference=Anon. n.d.(a) "[http://www.english-heritage.org.uk/discover/blue-plaques/search/bartok-bela-1881-1945 Bartók, Béla (1881–1945) Plaque erected in 1997 by English Heritage at 7 Sydney Place, South Kensington, London SW7 3NL, Royal Borough of Kensington and Chelsea]". English Heritage website (Accessed 19 October 2012).}}</nowiki></code> || {{wikicite|ref={{sfnref|Anon.|n.d.(a)}}|reference=Anon. n.d.(a) "[http://www.english-heritage.org.uk/discover/blue-plaques/search/bartok-bela-1881-1945 Bartók, Béla (1881–1945) Plaque erected in 1997 by English Heritage at 7 Sydney Place, South Kensington, London SW7 3NL, Royal Borough of Kensington and Chelsea]". English Heritage website (Accessed 19 October 2012).}}
! colspan="2" | using {{pipe}}ref= and {{pipe}}harvid=
|-
! colspan="2" | {{pipe}}id=sfnref
| <code><nowiki>{{vcite book |year=2020 |author=White, Red |title=Title |ref=WhiteOrange2020 |harvid=WhiteRed2020}}</nowiki></code> || {{vcite book |year=2020 |author=White, Red |title=Title |ref=WhiteRed2020 |harvid=WhiteOrange2020}}
|-
|<code><nowiki>{{wikicite | id = {{sfnref|Atwood|2003}} | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}</nowiki></code> || {{wikicite | id = {{sfnref|Atwood|2003}} | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}
|-
! colspan="2" | {{pipe}}ref=sfnref
|-
|<code><nowiki>{{wikicite | ref = {{sfnref|Atwood|2003}} | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}</nowiki></code> || {{wikicite | ref = {{sfnref|Atwood|2003}} | reference = Atwood, Margaret (2003). ''Oryx and Crake'', Toronto: McClelland & Stewart. {{ISBN|978-0-7710-0868-9}}. }}
|}
 
== harvcanchor ==
 
{| class="wikitable" width="100%"
|+{{tl|anchor}}
|+harvc
!template !! rendering
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|GeorgeBlue|ReadYellow|Johnson|Ferber|19572018}}</nowiki></code> || {{Harvard citation no brackets/sandbox|George|Read|JohnsonBlue|FerberYellow|19572018}}
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|Stefferud|1957plain text|ref=CITEREFStefferudplain prefacetext}}</nowiki></code> || {{Harvard citation no brackets/sandbox|Stefferud|1957plain text|ref=CITEREFStefferudplain prefacetext}}
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|CITEREF|citeref|2030|ref=CITEREFciteref2030}}}}</nowiki></code> || {{Harvard citation no brackets/sandbox|CITEREF|citeref|2030|ref=CITEREFciteref2030}}
! colspan="2" | {{tl|harvc}} templates
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|Yellow|Blue|2019}}</nowiki></code> || {{Harvard citation no brackets/sandbox|Yellow|Blue|2019}}
| <code><nowiki>{{harvc/sandbox |last=George |first=Ernest J. |last2=Read |last3=Johnson |last4=Ferber |year=1957 |contribution=Shelterbelts and Windbreaks |url=//archive.org/stream/yoa1957#page/n785/mode/1up |in=Stefferud}}</nowiki></code> || {{harvc/sandbox |last=George |first=Ernest J. |last2=Read |last3=Johnson |last4=Ferber |year=1957 |contribution=Shelterbelts and Windbreaks |url=//archive.org/stream/yoa1957#page/n785/mode/1up |in=Stefferud}}
|-
! colspan="2" | multiple anchors
| <code><nowiki>{{harvc/sandbox |last=Stefferud |first=A.|year=1957 |id=CITEREFStefferud preface |c=Preface |url=//archive.org/stream/yoa1957#page/n7/mode/1up |in=Stefferud}}</nowiki></code> || {{harvc/sandbox |last=Stefferud |first=A.|year=1957 |id=CITEREFStefferud preface |c=Preface |url=//archive.org/stream/yoa1957#page/n7/mode/1up |in=Stefferud}}
|-
| <code><nowiki>{{anchor|{{sfnref|Blue|Yellow|2018}}|plain text|CITEREFciteref2030|{{sfnref|Yellow|Blue|2019}}}}</nowiki></code> || {{anchor|{{sfnref|Blue|Yellow|2018}}|plain text|CITEREFciteref2030|{{sfnref|Yellow|Blue|2019}}}} anchors are here
! colspan="2" | cs1{{pipe}}2 templates
|-
|<code><nowiki>{{cite book |title=Soil: The Yearbook of Agriculture 1957 |editor-last=Stefferud |editor-first=Alfred |year=1957 |publisher=United States Department of Agriculture |url=//archive.org/stream/yoa1957#page/n2/mode/1up |oclc=704186906 |ref=harv}}</nowiki></code> || {{cite book |title=Soil: The Yearbook of Agriculture 1957 |editor-last=Stefferud |editor-first=Alfred |year=1957 |publisher=United States Department of Agriculture |url=//archive.org/stream/yoa1957#page/n2/mode/1up |oclc=704186906 |ref=harv}}
|}
 
==miscellaneous tests==
For these tests, consult the lua logs section of the debug console. To see that, edit this page and click Show preview. At the bottom, click Parser profiling data and then click show under Lua logs.
 
=== sfn whitelist ===
{{sfn whitelist|CITEREFBrand1968|CITEREFFine1994|CITEREFGeanakoplos1959|CITEREFVan_Tricht2011}}
This section has this template:
:<code><nowiki>{{sfn whitelist|CITEREFBrand1968|CITEREFFine1994|CITEREFGeanakoplos1959|CITEREFVan_Tricht2011}}</nowiki></code>
These four anchor IDs should appear in the <code>article_whitelist</code> table in the lua logs section of the debug console.
 
=== parser functions ===
This section has this template:
:<code><nowiki>{{#language:nv|en}}</nowiki></code> → {{#language:nv|en}}
parser functions should not appear in the <code>template_list</code> table in the lua logs section of the debug console.
 
==dynamic whitelisting==
 
{| class="wikitable" width="100%"
|+dynamic whitelisting
|+harvc with {{pipe}}anchor-year=
!template !! rendering
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|Hunt Adamson|Mitchell|1911|1995ap=135}}</nowiki></code> || {{Harvard citation no brackets/sandbox|Hunt Adamson|Mitchell|1911|1995ap=135}}
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|Hunt Jones|Bryant|1995b1911}}</nowiki></code> || {{Harvard citation no brackets/sandbox|Hunt Jones|Bryant|1995b1911}}
|-
! colspan="2" | {{tl|harvc}}simple templatescitations
|-
| <code><nowiki>{{harvc/sandboxEB1911 |inmode=McMillan |in2=Horobincs2 |last=HuntAdamson |first=DavidRobert |cauthor-link=AppendixRobert IAdamson Names(philosopher) and|last2=Mitchell synonyms|first2=John ofMalcolm the species|wstitle=Bacon, subspecies and interspecific hybridsFrancis |yearvolume=19953 |anchor-yearpages=1995a135–152 |mode=cs2 |nb=yes}}</nowiki></code> || {{harvc/sandboxEB1911 |inmode=McMillan |in2=Horobincs2 |last=HuntAdamson |first=DavidRobert |cauthor-link=AppendixRobert IAdamson Names(philosopher) and|last2=Mitchell synonyms|first2=John ofMalcolm the species|wstitle=Bacon, subspecies and interspecific hybridsFrancis |yearvolume=19953 |anchor-yearpages=1995a135–152 |mode=cs2 |nb=yes}}
|-
| <code><nowiki>{{harvc/sandboxcite EB1911 |inwstitle=McMillanCaesar, |in2=HorobinGaius Julius |lastvolume=Hunt4 |firstpages=David938–943 |cfirst1=AppendixHenry III Excerpts from a Brazilian diaryStuart |yearlast1=1995Jones |anchor-yearfirst2=1995bMargaret |modelast2=cs2Bryant |nbshort=yes1}}</nowiki></code> || {{harvc/sandboxcite |in=McMillanEB1911 |in2wstitle=HorobinCaesar, Gaius Julius |lastvolume=Hunt4 |firstpages=David938–943 |cfirst1=Appendix III Excerpts from a BrazilianHenry diaryStuart |yearlast1=1995Jones |anchor-yearfirst2=1995bMargaret |modelast2=cs2Bryant |nbshort=yes1}}
|-
! colspan="2" | cs1cite catholic encyclopedia uses {{pipe}}2 templatevolume=
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|Fanning|1907}}</nowiki></code> || {{Harvard citation no brackets/sandbox|Fanning|1907}}
|<code><nowiki>{{Citation |last=McMillan |first=A. J. S. |last2=Horobin |first2=J. F. |year=1995 |title=Christmas Cacti: The Genus ''Schlumbergera'' and Its Hybrids |edition=p/b |publication-place=Sherbourne, Dorset, UK |publisher=David Hunt |isbn=978-0-9517234-6-3}}</nowiki></code> || {{Citation |last=McMillan |first=A. J. S. |last2=Horobin |first2=J. F. |year=1995 |title=Christmas Cacti: The Genus ''Schlumbergera'' and Its Hybrids |edition=p/b |publication-place=Sherbourne, Dorset, UK |publisher=David Hunt |isbn=978-0-9517234-6-3}}
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|Fanning|1908}}</nowiki></code> || {{Harvard citation no brackets/sandbox|Fanning|1908}}
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|Fanning, William Henry Windsor|1913}}</nowiki></code> || {{Harvard citation no brackets/sandbox|Fanning, William Henry Windsor|1913}}
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|Herbermann|1913}}</nowiki></code> || {{Harvard citation no brackets/sandbox|Herbermann|1913}}
|-
! colspan="2" | volume citations
|-
| <code><nowiki>{{Cite CE1913|wstitle =Baptism |first=William Henry Windsor |last=Fanning|volume=2|ref=harv}}</nowiki></code> || {{Cite CE1913|wstitle =Baptism |first=William Henry Windsor |last=Fanning|volume=2|ref=harv}}
|-
| <code><nowiki>{{Catholic|last=Fanning|first=William H. W.|wstitle=Conservator|volume=4|ref=harv}}</nowiki></code> || {{Catholic|last=Fanning|first=William H. W.|wstitle=Conservator|volume=4|ref=harv}}
|-
| <code><nowiki>{{cathEncy|wstitle=Vicar of Christ|author=Fanning, William Henry Windsor}}</nowiki></code> || {{cathEncy|wstitle=Vicar of Christ|author=Fanning, William Henry Windsor}}
|-
| <code><nowiki>{{Cite CE1913 | wstitle = Ecclesiastical Heraldry}}</nowiki></code> || {{Cite CE1913 | wstitle = Ecclesiastical Heraldry}}
|-
! colspan="2" | cite EB9 uses {{pipe}}volume= allows roman numerals
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|Adamson|1878}}</nowiki></code> || {{Harvard citation no brackets/sandbox|Adamson|1878}}
|-
| <code><nowiki>{{Harvard citation no brackets/sandbox|Baynes|1878}}</nowiki></code> || {{Harvard citation no brackets/sandbox|Baynes|1878}}
|-
! colspan="2" | volume citations
|-
| <code><nowiki>{{cite EB9 |last=Adamson |first=Robert |authorlink=Robert Adamson (philosopher) |wstitle=Henry St John, Viscount Bolingbroke |volume=4 |pages=4–7}}</nowiki></code> || {{cite EB9 |last=Adamson |first=Robert |authorlink=Robert Adamson (philosopher) |wstitle=Henry St John, Viscount Bolingbroke |volume=4 |pages=4–7}}
|-
| <code><nowiki>{{eb9 |wstitle=Henry St John, Viscount Bolingbroke |volume=IV |pages=4–7}}</nowiki></code> || {{eb9 |wstitle=Henry St John, Viscount Bolingbroke |volume=IV |pages=4–7}}
|}