Module talk:Footnotes

This is an old revision of this page, as edited by Peter coxhead (talk | contribs) at 22:16, 15 December 2014 (Template:sfnp: clarified my earlier comment in the light of the later tweak). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Latest comment: 10 years ago by Trappist the monk in topic Template:sfnp

This doesn't work properly in Template:Sfn

Please see Template talk:Sfn#Lua version is broken. --Redrose64 (talk) 22:43, 2 April 2013 (UTC)Reply

Broken parameter

Please see Template talk:Harvard citation no brackets#Broken parameter. Similar templates are probably similarly broken. Wtmitchell (talk) (earlier Boracay Bill) 07:13, 28 April 2013 (UTC)Reply

This should be fixed. Dragons flight (talk) 10:18, 28 April 2013 (UTC)Reply

More than six parameters

It would help if the code was more compatible with CS1. At the moment it does not handle more than four authors elegantly. See Module talk:Citation/CS1#CITEREF and harvnb and CITEREF and CS1. -- PBS (talk) 13:09, 21 December 2013 (UTC)Reply

Markup

The Lua CS1 templates strip markup, such as bold or italics, where this module does not. Thus if markup is used in {{sfn}} or variant, then the link and anchor will not match. --  Gadget850 talk 11:28, 6 March 2014 (UTC)Reply

Protected edit request on 27 June 2014

Module:Citation/CS1 runs mw.uri.anchorEncode() on options.id before generating the <span id="... line. For compatibility between generated id in that module and the #CITEREF generated here, I think this change needs to be applied on this module.

(Here is an example footnote which is not linked to it's citation and I think it's because of the above mentioned problem.) Dalba 07:38, 27 June 2014 (UTC)Reply

  Done Thanks for the fix! — Mr. Stradivarius ♪ talk ♪ 12:15, 27 June 2014 (UTC)Reply

Template:sfnp

{{sfnp}} could usefully be implemented within this module as well as {{sfn}}. As far as I can see, function f.sfnp( frame ) would simply duplicate function f.sfn( frame ) with the addition of:

args.bracket_year_left = "(";
args.bracket_year_right = ")";

An oddity at present is that |postscript=none works for {{sfn}} but not for {{sfnp}}. Peter coxhead (talk) 20:21, 15 December 2014 (UTC)Reply

It does in a sort of round-about way:
{{sfnp}} calls {{Harvard citation/core}} calls Module:Footnotes function harvard_core().
Is |postscript=none necessary for {{sfnp}}? The code seems to indicate that {{sfn}} uses '.' for a default of postscript character. If |postscript= is empty or omitted, then {{sfnp}} uses an empty string as the default postscript.
Trappist the monk (talk) 20:38, 15 December 2014 (UTC)Reply
Nope, {{sfnp|James|2004}} generates the following footnote.[1]
(After the tweak noted below, {{sfnp|Smith|2005|ps=none}} generates the following footnote.[2])
  1. ^ James (2004).
  2. ^ Smith (2005)
So as a CS2 user, I end up with {{sfnp|ps=|...}} but would prefer |ps=none for same reason as you (well, actually I'd prefer another template, and did once create one, but the consensus was to delete it).
Doing things in a "round-about way" is a sure recipe for software errors (at least that's what I used to teach in first-year software engineering). The complexity of the current code is shown by the fact that it isn't easy to work out what {{sfnp}} actually does. A separate function is clearer and easier to maintain. Or perhaps better still (because more modular), pass appropriate parameters to f.sfn(). Peter coxhead (talk) 21:13, 15 December 2014 (UTC)Reply
Right, it gets it's postscript from the template call to {{Harvard citation/core}}. Module:Footnotes tweaked and I tweaked your example.
You'll get no argument from me in support of round-about code. Every line must be maintained. I'll think about integrating {{sfnp}} in the module.
Trappist the monk (talk) 22:02, 15 December 2014 (UTC)Reply