Module talk:Citation/CS1/Archive 2

Placement of volume + issue + year
Placing the publication year in between the volume number and the issue number doesn't seem like an improvement. Dragons flight (talk) 13:27, 13 March 2013 (UTC)
 * Lua version cannot be correct. Rjwilmsi 15:16, 13 March 2013 (UTC)


 * I moved the Issue= tag next to the Volume= tag, which fixes this. However, I'm suspicious that there may be other cases (other format modes?) where this breaks things.  All of the examples on this page right now seem okay, but we probably need to look carefully at this.  Dragons flight (talk) 02:27, 14 March 2013 (UTC)

Weird link formatting for encyclopedia class
Cite encyclopedia is doing something strange with the link here. Dragons flight (talk) 14:11, 13 March 2013 (UTC)


 * Probably because Cite encyclopedia handles title strangely:


 * Title=
 * TransTitle=
 * TransItalic=
 * IncludedWorkTitle=


 * I never could get a good answer on why title is used in both Title and IncludedWorkTitle, and that is one section I never updated. --— Gadget850 (Ed) talk 15:20, 13 March 2013 (UTC)


 * Looking again at the first example, I see that last is being used where it should be encyclopedia. If title is defined but not encyclopedia then title is used in quotes and again in italics. I meant to poke into this before but title should be the title of the included work and should always be in quotes. --—  Gadget850 (Ed) talk 20:36, 13 March 2013 (UTC)


 * Fixed. Dragons flight (talk) 00:29, 17 March 2013 (UTC)

Both page and pages
Lua behaves a little odd if both page= and pages= are specified at the same time. Arguably this should be considered a user error. Dragons flight (talk) 14:34, 13 March 2013 (UTC)
 * For the moment stick as is: pages overrides page. Hopefully once Lua templates are established we can look to add validation/tracking categories for these kinds of errors. Rjwilmsi 15:19, 13 March 2013 (UTC)


 * Made pages= override page= as suggested. Dragons flight (talk) 17:26, 13 March 2013 (UTC)

double dot with publisher
When the publisher name ends in a "." (e.g. "Google, Inc.", "MacMillan and Co."), this can lead to a double "." following the publisher. Dragons flight (talk) 14:47, 13 March 2013 (UTC)


 * I'll inspect the code, but I am not sure how many more double-dot problems we are facing. I have already fixed ".." after authors/editors or between "agency=" and page number, as well as ".." after book/periodical title. See examples in wp:CS1/test_problems. -Wikid77 19:54, 14 March 2013 (UTC)


 * Fixed. Dragons flight (talk) 22:03, 16 March 2013 (UTC)

Double dot at the end
Another way to get a double dot (i.e. ".."). Dragons flight (talk) 15:04, 13 March 2013 (UTC)
 * Fixed by quick check for " " at end of string named 'text'. -Wikid77 (talk) 19:00, 14 March 2013 (UTC)

Fixing brackets in titles
It has always been the case that having brackets in your title, e.g. [], can mess up the placement of url links. The standard templates advise that any titles requiring brackets should be manually converted to escape codes; however, it seems like it should be well within Lua's ability to detect this issue and automatically do the encoding. Dragons flight (talk) 15:30, 13 March 2013 (UTC)


 * I've made it so that embedded bracket are escaped automatically before generating the URL. Dragons flight (talk) 17:45, 13 March 2013 (UTC)
 * There are also problems with a newline (usually because it was copy/pasted) which should be converted to a space and with pipes, which we really can't so anything with. --— Gadget850 (Ed) talk 20:24, 13 March 2013 (UTC)
 * I added newlines to the filter. Dragons flight (talk) 01:49, 14 March 2013 (UTC)

format tag out of position
PDF label is out of position. Dragons flight (talk) 03:10, 14 March 2013 (UTC)


 * Fixed. Dragons flight (talk) 03:40, 16 March 2013 (UTC)

bold madness
Who ordered that? Dragons flight (talk) 03:35, 14 March 2013 (UTC)


 * Fixed. Dragons flight (talk) 03:59, 14 March 2013 (UTC)

The month= option
A new, rare option rears its head. Dragons flight (talk) 04:33, 14 March 2013 (UTC)
 * Month is not rare, but it should be used with year. I consider this an improvement. --— Gadget850 (Ed) talk 06:00, 14 March 2013 (UTC)


 * Do you mean that month= should be ignored if year= is not present? Dragons flight (talk) 15:21, 14 March 2013 (UTC)
 * Yes. Month and/or day without year makes no sense. As does day and year only. The Lua version suppresses this. --— Gadget850 (Ed) talk 15:39, 14 March 2013 (UTC)


 * Okay, I see what you mean. I'll leave this alone then.  Dragons flight (talk) 17:28, 14 March 2013 (UTC)


 * Please note that as presently coded (i.e. without Lua), all the citation templates (whether CS1 or CS2) categorise pages into when day is used. I have found that when the day parameter does get used, it's almost always with  The documentation for that states that the parameter is deprecated, and that date should be used to include the day, month and year. The documentation for date mentions year and month but not day. -- Red rose64 (talk) 23:16, 16 March 2013 (UTC)
 * Yes, day is deprecated, but it is still used in the date algorithm in all the CS1 templates. And it is displayed if you use it alone. Regardless, the Lua version handles this in a more sane manner by not showing invalid dates. --— Gadget850 (Ed) talk 23:41, 16 March 2013 (UTC)

Square brackets not quite in right places
-- WOSlinker (talk) 22:34, 19 February 2013 (UTC)

Anchors
Citation creates an anchor by default, where template create them only when ref is set. Citation/lua does not create the anchor by default. None of the Lua templates create the harv anchor properly: the year is missing. --— Gadget850 (Ed) talk 20:00, 20 February 2013 (UTC)
 * Set {Citation/lua} as ref=harv and put year. For any {Citation/lua}, the span-tag id now uses ref=harv format. The Lua script had to be changed to check for missing/empty "year=" and then extract the year from the date parameter to insert inside the span-tag id. -Wikid77 05:12, 22 February 2013 (UTC)

Separators
The biggest visible difference between citation and the CS1 templates is that citation uses a comma as a separator by default, while the CS1 ones use a period; this can be changed by the separator parameter. However, citation/lua always uses a period, and ignores the separator parameter. This should be fixed to match the existing templates. Another closely related problem is that citation/lua currently adds a spurious period after the issue number of a journal paper; e.g. renders as "College Mathematics Journal 33 (5).: 406–408". It should not have the period between the "(5)" and the following colon, and the periods after the publication year and the article title should both be commas. —David Eppstein (talk) 21:13, 20 February 2013 (UTC)
 * Reworking to handle separator: It will take a few days to fix all dots, but I will change each dot "." to allow comma when {citation} or separator=c as Lua variable "sepc". The parameters for AuthorSep and AuthorNameSep are already used. -Wikid77 22:46, 20 February 2013 (UTC)

Some tests
Here's a test for various other empty params -- WOSlinker (talk) 23:05, 20 February 2013 (UTC)
 * cite web:
 * cite web/lua:

Here's a test for output checking. Doesn't need to be exactly the same but should be similar. -- WOSlinker (talk) 23:10, 20 February 2013 (UTC)
 * cite web:
 * cite web/lua:


 * Working to omit blank parameters: I agree that blank parameters must be omitted because numerous articles contain several boilerplate templates where many optional parameters are blank in each cite. -Wikid77 00:48, 21 February 2013 (UTC)

Handling vast set of parameters
I see the migration to the Lua-based templates will affect a vast array of cite parameters, but I think we have over 100 parameters already close to the same format. If we keep going for another week, I think we can fix most issues, such as ref ids and Harvard referencing. However, many of the minor cite template forks, such as Template:Cite press release or Template:Cite_video, can remain in the markup version until we get time to handle all the format variations. Articles can have a mix of the Lua-based cites and original markup-based cites and still render. -Wikid77 05:20, 21 February 2013 (UTC)
 * Sounds very reasonable to me. —David Eppstein (talk) 06:06, 21 February 2013 (UTC)

series/volume/publisher order
It's very quickly becoming difficult to find any difference in formatting between this and the old templates — thanks for all the hard work! But here's one more. citation, for a book that has a series, a volume in the series, and a publisher, orders them series, volume, publisher: But citation/lua orders them series, publisher volume: Incidentally, I would be happy to see the boldfacing on the volume and the comma in front of it both go away, in this case, but maybe we should concentrate on matching what we already have before thinking about improvements. —David Eppstein (talk) 06:04, 21 February 2013 (UTC)
 * Reset order, checking volume prefix: For years, the plan for the volume has been to automatically unbold, such as for prefix "Vol" or "vol" and then put a comma. To force unbold, then insert tag "&lt;/b>" prefix, as "volume = &lt;/b>1668". The time to improve for prior suggestions is now, while people are still checking to see if it works. -Wikid77
 * I think http://xkcd.com/1144/ adequately expresses my opinion about using mismatched tags. —David Eppstein (talk) 08:27, 21 February 2013 (UTC)

Position of "location" versus "agency" fields
From Help talk:Citation Style 1:

As of this writing, the Cite news template has the  field follow the   field, rather than the  /  field (see the "No author but sourced to a news agency" example in the documentation), which is confusing, since per the documentation the location field refers to the location of the newspaper ("[g]eographical place of publication"), not that of the news agency.

This has been discussed twice before (Archive 5: Agency, newspaper, and location and Archive 5: "Location" of newspaper vs. "Location" of byline), but no conclusion/consensus was reached. Would someone please be so kind as to fix this?—DocWatson42 (talk) 09:09, 15 February 2013 (UTC)


 * I agree, this has needed fixing for a long time. The present situation is obviously illogical and wrong. (One of a number of such things often mentioned but never fixed.) -- Alarics (talk) 13:19, 15 February 2013 (UTC)
 * Please provide examples of current format and how you think it should be. --— Gadget850 (Ed) talk 15:31, 15 February 2013 (UTC)
 * See Singapore, footnote 62, which says "AsiaOne. Agence France-Presse (Singapore)." when it obviously should be "AsiaOne (Singapore). Agence France-Presse." -- Alarics (talk) 17:52, 15 February 2013 (UTC)
 * Another: The No author but sourced to a news agency example I referenced above, taken from the template's documentation:
 * As it is:
 * As it should be: "Drugs: Chips trader gets 15 years, 10 strokes". Daily Express (Kota Kinabalu, Malaysia). Bernama. 29 March 2007.
 * —DocWatson42 (talk) 14:47, 17 February 2013 (UTC)


 * Comparison with Lua version: The placement of the "location=" parameter could be shifted for only citation class "news" where other cites could have some alternate format:
 * Cite_news:
 * Cite_news/lua:
 * If there is confusion with a shift in parameters, then we could alter the format for the cite class "news" only. -Wikid77 15:12, 21 February 2013 (UTC)
 * If that fixes the problem, then I'm for it.—DocWatson42 (talk) 03:39, 10 March 2013 (UTC)
 * And it seems that the correction has been made (albeit without an announcement in this section), since the "problem" examples now match the "desired" examples. Thanks!—DocWatson42 (talk) 05:56, 24 March 2013 (UTC)

Transition Phase-3: Install Cite_encyclopedia/lua
The wp:CS1 cite template needs to redirect to use Template:Cite_encyclopedia/lua, as invoking the Lua script version in Module:Citation/CS1.

After weeks of testing, and hundreds of small format changes, we are ready for phase 3 of the markup-to-Lua transition, as installing {cite_encyclopedia/lua} as {cite_encyclopedia}. Some parameters have been shifted slightly, to allow better placement of the "trans_title=" translation text following the "title=" words. Example: The transition of {cite_encyclopedia} will be the first wp:CS1 cite template to use Lua script, as a limited test among only 61,000 articles, before expanding to {cite_news} used in nearly 1/2 million pages. Other Lua-based templates have been used safely in over 600,000 articles. -Wikid77 (talk) 16:24, 7 March 2013 (UTC)
 * Parameters:
 * Cite encyclopedia/old:
 * Cite encyclopedia/lua:


 * Question. old shows pp. 77. and lua shows p. 77. -  Is this a deliberate difference? -- WOSlinker (talk) 16:38, 7 March 2013 (UTC)
 * Yes; the examples use pages and the Lua version can autodetect singular v. multiple pages in the field.
 * I am inclined to do this, but:
 * Need the exact markup to update the current template
 * Need to post notices at WP:VPT and Help:CS1 so if something goes bonk, our fellow editors will know what is going on.
 * --— Gadget850 (Ed) talk 16:52, 7 March 2013 (UTC)
 * See below: "". -Wikid77 (talk) 23:15, 7 March 2013 (UTC)
 * There is one problem, using the "Download as PDF" option does not run LUA templates. See User talk:Dragons flight. for issue with LUA coord template. I've have just tested with LUA cite and get same issue. -- WOSlinker (talk) 19:26, 7 March 2013 (UTC)


 * Well that's a bitch. Bugzilla-ho!  Dragons flight (talk) 20:07, 7 March 2013 (UTC)
 * I've disabled the request until we hear back from the developers about the pdf issue. Judging from 45861, that might not be too long. Please activate it again when everything is ready. Also, Gadget850's suggestion of posting at WP:VPT and Help:CS1 before we make the update seems eminently sensible. Best — Mr. Stradivarius  ♪ talk ♪ 02:44, 9 March 2013 (UTC)

In the discussion of 45861 there is a request from the Foundation that we hold off on migrating citations for a week to give them the chance to address that bug. That seems reasonable to me, and they seem to be allocating real time and resources to making Lua compatible with PDF export, which is a good thing. So, I'd suggest we hold off to give them a chance to fix that before we make all the references disappear from the PDFs. Beyond that, I'm willing to help oversee making the protected edits to make the change over. Generally, what I would be looking for is a test page showing several before and after examples for each major template class being updated, as well as notes identifying any intentional changes. CS1/test_basics and CS1/test_problems seems like a start on that, but focuses mostly on cite web, and it would be nice to have a clearer list noting intentional changes (perhaps there is a general list somewhere else?). Assuming there is agreement on waiting for the PDF issue, I don't see any reason that we can't go ahead and prepare before and after examples now. Dragons flight (talk) 18:29, 11 March 2013 (UTC)

Book without title
I found this little gem in the wild, a book with no title. It appears as though the cite was being used in the reference list like an sfn, so that a more complete citation appeared elsewhere in the references. I'm half-tempted to say that a book with no title should actually be considered an error (i.e. with an error message / error cat ). Dragons flight (talk) 18:44, 12 March 2013 (UTC)


 * Fixed to match, though I would still think this ought to be an error. Dragons flight (talk) 00:13, 17 March 2013 (UTC)

publication-date missing
--— Gadget850 (Ed) talk 21:09, 13 March 2013 (UTC)


 * Fixed. Dragons flight (talk) 01:50, 14 March 2013 (UTC)

If publication-date but not date, then publication-date should be used as date:

And it should be applied to the anchor as well. --— Gadget850 (Ed) talk 13:15, 14 March 2013 (UTC)


 * I made this change. Dragons flight (talk) 15:29, 14 March 2013 (UTC)


 * The date is not being applied to the anchor. And it should extract the year only if a full date is used. We in the process of making this fix to the regular templates.



I think this should work now, though you might want to try some other examples to be sure. Dragons flight (talk) 17:20, 14 March 2013 (UTC)

Some years not being included in the anchor is now fixed
I see that the issue with some years not being included in the anchor is now fixed with the Lua versions. This occurred when a year only was included in date

In the old version the anchor is  and in the Lua it is properly. --— Gadget850 (Ed) talk 13:02, 14 March 2013 (UTC)

Need to do more testing to see how the date parameter handles various forms. --— Gadget850 (Ed) talk 13:02, 14 March 2013 (UTC)


 * And now it is broken. The anchor for both is now . FYI: I use a script to see these errors: User:Ucucha/HarvErrors.js. --—  Gadget850 (Ed) talk 20:45, 18 March 2013 (UTC)


 * Should be better now. Silly three-digit years.  Dragons flight (talk) 22:28, 18 March 2013 (UTC)
 * More better. --— Gadget850 (Ed) talk 22:31, 18 March 2013 (UTC)