User:Diberri/Template filler

Dave's Template Filler (for lack of a better name) is a tool for generating template markup quickly and simply. It uses identifiers such as ISBNs and PubMed IDs to fill templates such as cite book and cite journal. (If you haven't added references on Wikipedia before, see also Footnotes for additional context.)

The tool is available here: citation-template-filling.

Usage
There are several ways to use the template filler.

Web-based tool
The web-based tool is the most common way to access the template filler:
 * http://tools.wmflabs.org/citation-template-filling/cgi-bin/index.cgi

Its usage is mostly self-explanatory. Options may need further explanation. (See Options below.)

Firefox keywords
Firefox allows keyword-based access to the template filler. From the template filler page, select the desired identifier (eg, PubMed ID, ISBN, etc.), right-click (or control-click) on the search field, and select "Add a keyword for this search". Enter a name, a keyword (eg, "pmid"), and press enter. Type keyword id into Firefox's location bar, where keyword is the keyword you just entered (eg, "pmid") and id is a value for this identifier (eg, "123455"). A complete example would be pmid 123455, which would load this page.

Bookmarklets
Bob Badgett maintains a few bookmarklets for making the template filler even more accessible. These are available at his website, Diberri bookmarklets.

Greasemonkey


If you have Firefox's Greasemonkey extension, you can use these user scripts to automatically create links to PubMed and Google Book citations:
 * PubMed
 * Google Books

Perl module
The template filler can be called programatically from Perl using WWW::Wikipedia::TemplateFiller, a module available from CPAN.

XML output
The web-based template filler can generate XML to make for easier programmatic access using Ajax or other frameworks. This can be accomplished by adding "&amp;format=xml" to the end of the URL, as in:
 * http://toolserver.org/~diberri/cgi-bin/templatefiller/index.cgi?type=pubmed_id&id=123455&format=xml

Options
The template filler recognizes a number of options that customize its output:
 * Fill vertically
 * Fills the template vertically as opposed to horizontally.


 * Show extended fields
 * Lists "extended" fields in addition to the standard fields of that template. The definition of "extended" varies based on template.


 * Pad parameter names and values
 * Adds a space before and after each pipe character ("|"), possibly improving readability


 * Add access date (if relevant)
 * If the current template recognizes an access_date parameter, then fill it with the current date. Not recommended when citing journals.


 * Add ref tag
 * Add &lt;ref id="ref_name"&gt; to the output.


 * Add URL (if available)
 * If the current template recognizes a url parameter, then fill it with an appropriate URL.
 * For cite journal if the template filler finds a PubMedCentral PMC or a URL for the journal article, the article title is linked. If both, the article title is linked to the URL value and the PMC value is shown. Similarly for cite book any url parameter links on the title field.


 * Don't strip trailing period from article title
 * (Only applies to PubMed and PubMedCentral sources.) PubMed and PubMedCentral articles nearly always end with punctuation, and cite journal adds a period to the end of the <tt>title</tt> parameter by default. To omit a duplicate period, the template filler by default strips trailing periods from the article title. This option disables the routine stripping of trailing periods.


 * Don't use et al for author list
 * (Only applies to PubMed and PubMedCentral sources.) PubMed and PubMedCentral articles may have many authors. When this number exceeds six (arbitrarily), the template filler uses the first three authors and appends et al to the author list. This option disables this feature so that et al is never used.


 * Link journal title
 * (Only applies to PubMed and PubMedCentral sources.) Links the journal article in the template markup. Note that this will link the abbreviation of the journal, so it is possible that the link will be red even if an article for the journal exists.

How to find a PMID
Despite its name, the PubMed database indexes papers from many fields that are only indirectly associated with medicine. If you can find the PMID associated with an article, generating a citation becomes very easy. However, it can be difficult sometimes to find a journal article in Pubmed. Here are some tips that may help:


 * Use Google search instead, and append "PMID"
 * If you're searching for it, other people have searched for it, and some of them may have found it. If a paper is well-known (for example, ), you can take advantage of the fact that other people are probably linking to it as well, and thus the paper you want may float to the top. Note the results of the following search: http://www.google.com/search?q=watson+crick+pmid
 * If you know the title: http://www.google.com/search?q=pmid+%22Molecular+structure+of+nucleic+acids%22
 * These approaches don't always work. Sometimes the title is short, and the names of the authors are common words. Or you might only have a partial citation. Some citations only list the journal, author, and indexing information. In this case, try searching on the author's name, the year, and the first page. (Don't search on the last page. Some citations might list pages "737-738", and others might list pages "737-8". Adding the 738 could reduce your chances of finding the right citation.)
 * If there are many authors, try using the last name of the first three or four authors. Don't use middle initials (there is variation in how these are rendered.) Skip authors with a diacritic.
 * Don't use the journal name unless you have no other choice (these abbreviations vary greatly)
 * You can also try Google Book Search and Google Scholar (though backlinks don't help as much with these tools.) Even if you don't have free full access to the resource in question, you can sometimes get information to help you refine your search.
 * Use PubMed, but with search parameters

Questions
Please direct questions, concerns, and bug reports over to User talk:Diberri/Template filler.