Module talk:Citation

Page contents not supported in other languages.
From Wikipedia

Context-specific formatting[edit]

I would like to explore the possibility of having the authors, in particular, recorded in full but displayed according to a control parameter.

The situation which gives rise to this is where I am using {{cite journal}}, for example, to record a citation and want to use it in several articles. However one article might have all the existing citations showing authors in "Vancouver Style" (which is "Surname, FM") whereas another might show them in full (i.e. "Surname, Forename Middle") although the more usual style is "Surname, Forename M." (note the trailing full-stop) which is what the Citation Bot tries to establish (although it does become gruesomely unstuck on forenames with non-ASCII letters ;-).

So I was wondering whether we could record an author as {{…| last = Surname | first = Forename Middle |…}} and supply a parameter to control the formatting; thus …| author-format = vanc |… for bare initials, …| author-format = full |… for full names and the default being to reduce second and subsequent names to initials.

I know that we can currently supply …| ref = harv |… to control the generation of HTML anchors, etc, so it should not be such a leap for more obvious changes to be possible.

HTH HAND —Phil Boswell (talk) 15:14, 30 August 2012 (UTC)[reply]

Should change to match enwiki CS1 cites[edit]

I think the format of the Lua cites should be changed to more closely match the en:wp:CS1-style templates on enwiki. Specifically, the following should be changed:

  • Phrase "Accessed on" should be "Retrieved".
  • When no author/editor, then omit parentheses/brackets "( )" from date.
  • A dot (or "separator") should be placed after the date, as "(1 May 2012)."
  • The double-dot ".." after some titles should be a single "." separator.

If there are no objections, then I will make those changes, into Module:Citation, later this week. -Wikid77 (talk) 13:24, 16 October 2012 (UTC)[reply]

Once you've finished with that, I'll set about fixing the "blank parameter" problem. I'm not sure whether you ought to be using HTML or Wikicode for your formatting: why have you changed the latter to the former? —Phil Boswell (talk) 09:14, 18 October 2012 (UTC)[reply]
I changed the italic title to use "<i>" rather than double " ' ' " to allow a lead apostrophe in a book title, such as " 'Tis Truly a Title", to avoid the triple-apostrophe bolding: "Tis Truly a Title". -Wikid77 (talk) 06:23, 19 October 2012 (UTC)[reply]

Updated Lua Module:Citation to exactly match wp:CS1 style[edit]

I have updated the fast Lua script (to closely match enwiki cites) in Lua Module:Citation (which gets "{#invoke:}" from each {cite_xxx} on test2.wiki). The format differences now are minor, so comparisons to CS1 {cite_web} or {cite_book}, here, will not be as alarming as during the past months (accessdate now shows "Retrieved"). Note well, all 24-25 forks are to be handled in the one giant Lua module (which checks: config.CitationClass == "news" or such). If it becomes a maintenance nightmare, then we could fork it as 2 variations: a simple variation to handle the major {cite_web} /news/book/journal, versus the current complex version to handle all other 20 forks (such as {cite_video}, {cite_document}, etc.). However, the one giant Module (for all) might be okay; I just want to note the option to fork the module, if it seems far too complex to update that way. Anyway, I want to re-emphasize how the Lua version (with en:COinS metadata) is already 8x-10x faster than {cite_web) and 2.3x smaller in template include-size bytes, to fit over 800 citations while handling all those "230" rare cite parameters. I copied a version of article "en:Barack Obama" to test2.wiki, for comparing cites, as "test2:Barack Obama". Feel free to inspect the progress, or update the Lua script as you wish. -Wikid77 06:23, 19 October 2012 (UTC)[reply]

Zotero does not seem to detect the COinS metadata although I see the metadata present in the source of the Barack Obama test article. Could someone more knowledgeable please check. Shyamal (talk) 10:11, 18 February 2013 (UTC)[reply]
Ok, I think I found that Zotero works if the
rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3A&
- is tweaked to include book / journal
rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&
- not sure if it is a Zotero limitation. Shyamal (talk) 10:54, 19 February 2013 (UTC)[reply]
I have tested this and it seems to work - but my fix is a bad one - someone who knows LUA please edit the reassignment of the variable rather than append the "book" / "journal" string to "info:ofi/fmt:kev:mtx:" (and deal with other possibilities as per the COinS specification) according to the situation. Shyamal (talk) 13:25, 19 February 2013 (UTC)[reply]