Content deleted Content added
→implementing sfnm and sfnmp: new section |
|||
Line 203:
:There having been no further comments, updated. Remember, {{tq|there will likely be temporary script errors because it is not possible to simultaneously update the module and all of the templates.}}
:—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 12:30, 11 August 2018 (UTC)
== implementing sfnm and sfnmp ==
{{tlx|sfnm}} and {{tlx|sfnmp}} are more-or-less clones of each other and each calls its own {{tlx|sfnm/core}} and {{tlx|sfnmp/core}} which also are more-or-less clones of each other – {{tld|sfnmp/core}} parenthesizes the year whereas {{tld|sfnm/core}} does not.
I have hacked [[Module:footnotes/sandbox]] to support {{tld|sfnm}} and {{tld|sfnmp}} so that these templates use the same core code that supports the {{tlx|sfn}} and {{tlx|harv}} templates. The implementation should be indistinguishable from the current version with minor exceptions.
this example uses positional parameters that include white space which the live templates do not ignore:
:<code><nowiki>{{Sfnm |One |2001 |1p=15 |Two |2002 |2p=2}}</nowiki></code>
::live{{Sfnm |One |2001 |1p=15 |Two |2002 |2p=2}} – creates this: <code>FOOTNOTESmith_2005_15Jones_2004_2</code>
::sandbox{{Sfnm/sandbox |One |2001 |1p=15 |Two |2002 |2p=2}} – creates this: <code>FOOTNOTESmith200515Jones20042</code>
{{reflist-talk}}
the arbitrary 10-source limit is removed:
:<code><nowiki>{{sfnm|One|2001|Two|2002|Three|2003|Four|2004|Five|2005|Six|2006|Seven|2007|Eight|2008|Nine|2009|Ten|2010|Eleven|2011|Twelve|2012|Thirteen|2013|Fourteen|2014|Fifteen|2015}}</nowiki></code>
::live{{sfnm|One|2001|Two|2002|Three|2003|Four|2004|Five|2005|Six|2006|Seven|2007|Eight|2008|Nine|2009|Ten|2010|Eleven|2011|Twelve|2012|Thirteen|2013|Fourteen|2014|Fifteen|2015}}
::sandbox{{sfnm/sandbox|One|2001|Two|2002|Three|2003|Four|2004|Five|2005|Six|2006|Seven|2007|Eight|2008|Nine|2009|Ten|2010|Eleven|2011|Twelve|2012|Thirteen|2013|Fourteen|2014|Fifteen|2015}}
{{reflist-talk}}
combinations of named and positional parameters are supported:
:<code><nowiki>{{sfnm|One|2001|2a1=Two|2a2=Three|2y=2000|Four|2004}}</nowiki></code>
::live{{sfnm|One|2001|2a1=Two|2a2=Three|2y=2000|Four|2004}} – Four's work is omitted
::sandbox{{sfnm/sandbox|One|2001|2a1=Two|2a2=Three|2y=2000|Four|2004}}
:<code><nowiki>{{sfnm|1a1=Two|1a2=Three|1y=2000|One|2001|3a1=Two|3y=2002|Four|2004}}</nowiki></code>
::live{{sfnm|1a1=Two|1a2=Three|1y=2000|One|2001|3a1=Two|3y=2002|Four|2004}} – One's work is omitted; Two and Four are not in proper order
::sandbox{{sfnm/sandbox|1a1=Two|1a2=Three|1y=2000|One|2001|3a1=Two|3y=2002|Four|2004}}
{{reflist-talk}}
accepts without comment {{para|{{var|n}}ps|none}} and supports {{para|ps|none}}:
:<code><nowiki>{{Sfnm|One|2001|1ps=none|1p=15|Two|2002|2p=2|ps=none}}</nowiki></code>
::live{{Sfnm|One|2001|1ps=none|1p=15|Two|2002|2p=2|ps=none}}
:<code><nowiki>{{Sfnm/sandbox|Two|2002|1ps=none|1p=15|Three|2003|2p=2|ps=none}}</nowiki></code>
::sandbox{{Sfnm/sandbox|Two|2002|1ps=none|1p=15|Three|2003|2p=2|ps=none}}
{{reflist-talk}}
all of the above have illustrated {{tld|sfnm}} though the same applies to {{tld|sfnmp}}:
:<code><nowiki>{{Sfnmp|One|2001|1p=15|Two|2002|2p=2}}</nowiki></code>
::live{{Sfnmp|One|2001|1p=15|Two|2002|2p=2}}
::sandbox{{Sfnmp/sandbox|One|2001|1p=15|Two|2002|2p=2}}
{{reflist-talk}}
{{refbegin|30em}}
*{{cite book |title=Title |last=One |date=2001 |ref=harv}}
*{{cite book |title=Title |last=Two |date=2002 |ref=harv}}
*{{cite book |title=Title |last=Three |date=2003 |ref=harv}}
*{{cite book |title=Title |last=Four |date=2004 |ref=harv}}
*{{cite book |title=Title |last=Five |date=2005 |ref=harv}}
*{{cite book |title=Title |last=Six |date=2006 |ref=harv}}
*{{cite book |title=Title |last=Seven |date=2007 |ref=harv}}
*{{cite book |title=Title |last=Eight |date=2008 |ref=harv}}
*{{cite book |title=Title |last=Nine |date=2009 |ref=harv}}
*{{cite book |title=Title |last=Ten |date=2010 |ref=harv}}
*{{cite book |title=Title |last=Eleven |date=2011 |ref=harv}}
*{{cite book |title=Title |last=Twelve |date=2012 |ref=harv}}
*{{cite book |title=Title |last=Thirteen |date=2013 |ref=harv}}
*{{cite book |title=Title |last=Fourteen |date=2014 |ref=harv}}
*{{cite book |title=Title |last=Fifteen |date=2015 |ref=harv}}
*{{cite book |title=Title |last=Two |last2=Three |date=2000 |ref=harv}}
{{refend}}
Without objection I shall update the live versions of these two templates and the module.
—[[User:Trappist the monk|Trappist the monk]] ([[User talk:Trappist the monk|talk]]) 11:08, 13 August 2018 (UTC)
|