![]() | This page is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
((sfn))
so that it uses this style? Is this more standard? I think it's worth a discussion over at ((sfn))
. I've been thinking that the "((harvtxt))
" style would look better in ((sfn))
for some time now and have been considering making the change. Apparently we think alike.((sfnp))
to ((harvard citation documentation))
. This will help editors to find it when new problems or issues are discovered, when bots are designed, and etc.. I think it should be treated similarly to ((harvcol))
: as a variation on the more standard ((sfn))
.((sfnp/date))
. WikiMedia's transclusion technology is very inefficient at the current time and people have noticed that articles with high number of transclusions can load extremely slowly. Using a "subtemplate" effectively doubles the load time. In a large article this can be noticeable. This is why all the other templates in the ((harv))
family don't use subtemplates. (It's a pain, because it would be great to share code between all of them, but that's the way it is for now.)--- CharlesGillingham (talk) 16:09, 10 May 2011 (UTC)
((sfn))
; there may be people using the current style who prefer it. We should probably ask there.((sfnp))
to ((harvard citation documentation))
, although I was also thinking of creating ((harvp))
that outputs in the same format as ((sfnp))
does, in place of having to use ((harvtxt))
and manually specify the page number. I was also thinking we should have ((sfncol))
and ((sfncolp))
to do the equivalents using colon page number notation, along with ((harvcolp))
. Thoughts?((sfnp/date))
. In general, though, I wonder if it's worth the increase in confusion caused by trying to avoid subtemplates. The comment on WP:SUBST says don't worry about performance (WP:PERF) except in extreme cases. Have you actually seen cases where substing a subtemplate really makes that much difference? BTW doesn't the server cache the results of rendering pages?Benwing (talk) 01:32, 11 May 2011 (UTC)
((#if:||(({2|))))}
in place of just (({2|))}
? I copied these from ((harvtxt))
but I can't for the life of me see the point of it. Benwing (talk) 01:32, 11 May 2011 (UTC)((sfn))
on the major issues. On your other questions:((vancite book))
and ((vcite book))
in part to address this issue. He could probably point you to some discussions where there is concrete data. You could also ask User:SlimVirgin. She is very critical of citation templates and slow load time is one of the strongest arguments against them. She would be able to point you towards discussions where citation templates are criticized."Premature optimization is the root of all evil."
((#if:||(({2|))))}
strips leading and trailing blanks from (({2))}
. ---- CharlesGillingham (talk) 17:23, 11 May 2011 (UTC)((#if:||(({2|))))}
, or something like $$2 if you want leading/trailing whitespace preserved, etc.((sfn))
:((#tag:ref| %% Link to citation template [[#CITEREF $1 $2 $3 $4 $5 | %if $5 (($1 et al. $5)) %% 4 or more authors %elif $4 (($1, $2 & $3 $4)) %% 3 authors %elif $3 (($1 & $2 $3)) %% 2 authors %else (($1 $2)) %% 1 author ]] %% Location or page number(s) (%if $loc ((, $loc)) %elif $p ((, p. $p)) %elif $pp ((, pp. $pp)) ) . %% Footnote name |name=FOOTNOTE $1 $2 $3 $4 $5 $p $pp $loc ))
((sfn))
, but it's much easier to read and write, and much less error-prone. The basic idea is that whitespace isn't significant except in double parens ((...))
or when escaped with a backslash; so you're free to space out the code to make it look nice. Single parens are used for grouping; the main use for this is in conjunction with constructs like %if, where the arguments need to be either a single word or a balanced expression. In this case the parens around the second %if aren't actually needed but can be useful to show more clearly the extent of the conditional.((sfnp/date))
without actually increasing the load time, since the substitution happens when the code is converted to normal template code. Benwing (talk) 02:48, 13 May 2011 (UTC)