LegacyCollector

Home | Legacy Firefox Extensions | Content Policy | Contact

Cite4Wiki

Author(s):



Overview

Cite4Wiki is a pair of contextual menu items (one for U.S.-style date formatting, one for "international" or UK-style). Right-click on the currently viewed webpage, and select one of the Cite4Wiki context menu options (they both have a Wikpedia logo, one also with a U.S. flag) to grab information about the webpage, format it as a proper Wikipedia inline source citation, and put that on the clipboard for pasting into a WP article.

Ver. 1.4 output:

<ref>{{Cite web |title=Page Title |url=page's URL |work=site.name |accessdate=today's date in [D]D Monthname YYYY format}}</ref>

If you edit the .xpi file you can make Ver. 1.4 use the 1.3 layout, below, but wih all of 1.4's new features.

Ver. 1.3 output:

<ref>{{Cite web
|title=Page Title
|url=page's URL
|work=site.name
|accessdate=today's date in [D]D Monthname YYYY format
}}</ref>


If the article uses American English, you can use the second of the two context menus to get the same code, but with a U.S.-format "Monthname [D]D, YYYY" accessdate in it.

You can then add additional details such as the author, publisher (company) and publication date (facts the add-on cannot magically find for you, unfortunately). And be sure to check that the "title=" field makes sense - the plugin just grabs this from the <title> element of the webpage.


Compatibility & testing

Tested successfully with Firefox 3.5.5, 3.5.7, 3.6, and 4.0b9 on Win XP SP3 and Win Vista SP2. Also tested successfully with Flock 2.5.6 on Vista. No Linux or Mac problems have been reported with either browser. Though it seemingly should, the add-on does not work with Seamonkey 2.0.2 through 2.0.11 (it is untested with 2.1b*); Seamonkey's handling of context menu items simply seems to be different from that of Firefox. Untested with Firefox Mobile (Fennec); would probably need a clipboard add-on as well, in order to do anything at all.


Validation and security

Validates with zero errors, and a few minor warnings. The warnings are generated because the add-on accesses the clipboard, a necessary part of its functionality.


Getting Ver. 1.4

If 1.4 remains unreviewed by addons.mozilla.org admins, you can still get and install it, from https://addons.mozilla.org/addon/cite4wiki/versions/.


Installing in Firefox 4.0 beta

If your Firefox beta does not want to install the add-on, you need to edit prefs.js in your profile. The location of your profile depends on what operating system you are using. Add the line:

user_pref("extensions.checkCompatibility.4.0b", false);

If this doesn't work, ensure all of the following are set as shown here:

user_pref("extensions.bootstrappedAddons", "{}");
user_pref("extensions.checkCompatibility.4.0b", false);
user_pref("extensions.databaseSchema", 3);
user_pref("extensions.lastAppVersion", "4.0b9");
user_pref("extensions.pendingOperations", false);


You may need to modify "4.0b9" to something newer at some point (e.g. "4.0b10pre", etc.) if a new release comes out between this posting and your installation attempt.


Customizing Ver. 1.4 output

If you prefer a vertical layout to a horizontal one, rename the chrome/content/cite4wiki.js file (chrome\content\cite4wiki.js in Windows) to cite4wikiHorizontal.js and rename cite4wikiVertical.js to cite4wiki.js in the same location, re-ZIP the files (not the directory too!) into a new cite4wiki.zip, rename it to cite4wiki.xpi, and restart your browser.

Someday, this will hopefully be a selectable option in the addon's "Options" menu.

A horizontal layout (the default upon installation) is the format used by at least a narrow majority of Wikipedians (especially those who focus on prose), because it makes a paragraph look more like a paragraph. Example, with fake prose:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer eget velit quis purus pharetra facilisis. Pellentesque at elit sit amet orci feugiat placerat suscipit rhoncus erat.<ref>{{cite web |url= http://www.example.com/directory/part1.html |title=The Great Example, Part 1 |first= |last={{err|{{AUTHOR MISSING}}}} |work=example.com |year=2011 [last update] |accessdate=18 January 2011}}</ref> Curabitur tempor lacus et urna luctus egestas nec sit amet metus. Nam nisl ante, euismod rutrum iaculis a, blandit feugiat est.

In Wikipedia editing windows (and many external text editors as well as Web browsers), this long line auto-wraps.

The vertical layout is favored by some editors (especially those who do a lot of sourcing), because it makes the citations easier to read and edit. This format is actually preferred when sources are put into the <references> area instead of entered inline in the prose. Example:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer eget velit
quis purus pharetra facilisis. Pellentesque at elit sit amet orci feugiat
placerat suscipit rhoncus erat.<ref>{{cite web
|url= http://www.example.com/directory/part1.html
|title=The Great Example, Part 1
|first=
|last={{err|{{AUTHOR MISSING}}}}
|work=example.com
|year=2011 [last update]
|accessdate=18 January 2011
}}</ref> Curabitur tempor lacus et urna luctus egestas nec sit amet metus. Nam nisl ante, euismod rutrum iaculis a, blandit feugiat est.



Cleaning up parameters after pasting

Note that in both cases, the add-on puts a default error message in place of author's family name; it will appear as a red error message when rendered. This is to ensure that users of the add-on check and correct the entries they paste into real Wikipedia pages. Either the author's name should be filled in (add a `|coauthors=` parameter for any second and subsequent coauthors), or replaced by something like `` so that those who examine the citation code know that the author was not left blank accidentally.

The `title=` parameter in particular should be checked for acccuracy. Often it will simply default to the site name (which is already used in the `work=` parameter), or otherwise be unhelpful. Look for a heading in the content that provides the title of the document. If the title in title bar (provided by `<title>...</title>` in the HTML, used by default by this add-on) and a title specified in the content are at odds with each other, usually prefer the one given in the content, since the one in the title bar may have been left over from a copy-paste operation or authoring template. If the title bar gives navigation, this should generally be removed, e.g. `Articles > 2012 > Movie Reviews > Aliens vs. Smurfs` should be reduced to simply `Aliens vs. Smurfs` or perhaps `Movie Reviews > Aliens vs. Smurfs`.

The `year=` parameter should be replaced with a more accurate year, or with an even more accurate full `date=` parameter, if the document being cited provides this information. By default, the add-on simply uses the last-modified date as reported by the HTTP headers, and notes that this is the type of date being reported. This is not the ideal date to use, since any change to any content on the rendered page (e.g. a banner ad) can produce a last-modified date that is newer than the publication date of the content. If the document specifies no publication date, look for a copyright date or date range (usually at the page bottom) and use that: `|year=2008–2011 [copyright date]`. If the citation in question has been auto-detected as a journal, book or other type of item that has a template more specific than {{cite web}}, the add-on may not attempt to provided an auto-generated date at all, since the date (or for books, year) will almost certainly be provided in the text of the cited page and will need to be added to the template code manually.


Other wikis

The source code of this add-on is relatiely easy to modify for other wikis. Just change the name of the target template and parameters.

Download files:

cite4wiki-1.3.1-signed.1-signed.xpi
cite4wiki-1.4.1-signed.1-signed.xpi




This page is part of the LegacyCollector website.
Disclaimer: All material on this site is property of their respective owners and available under
open licenses to the best of our knowledge. If you are an author and would like anything removed,
then please write an e-mail to legacy [at] collector dot org.