Nothing Special   »   [go: up one dir, main page]

Jump to content

Extension:Mendeley

From mediawiki.org
MediaWiki extensions manual
Mendeley
Release status: unmaintained
Implementation Parser function
Description Pulls data from the Mendeley API into wiki pages
Author(s) Nischay Nahata (Nischayn22talk)
Latest version 0.1 (March 2018)
MediaWiki 1.25+
PHP 5.3+
Database changes No
License GNU General Public License 2.0 or later
Download
$wgMendeleyConsumerKey, $wgMendeleyConsumerSecret

The Mendeley extension uses parser functions to pull data from the Mendeley API into wiki pages. Mendeley is an academic reference manager. It also provides a form input when used with the PageForms extension to search and add a document.

Installation

[edit]
  • Download and place the file(s) in a directory called Mendeley in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'Mendeley' );
    $wgMendeleyConsumerKey = /* Mendeley Application KEY GOES HERE */;
    $wgMendeleyConsumerSecret = /* Mendeley Application Secret GOES HERE */;
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration parameters

[edit]
$wgMendeleyConsumerKey
(Required) Your Application ID from Mendeley
$wgMendeleyConsumerSecret
(Required) Your Application Secret from Mendeley

To get these values you need to Login and Register an application here: http://dev.mendeley.com/myapps.html

Usage

[edit]

The mendeley parser function takes three parameters, in the form of {{#mendeley:doi=DOI|id=ID|parameter=PARAMETER}}.

Where one of id or doi is required to identify the document and "parameter" is the name of the parameter that should be displayed. The full list of parameters is available here.

To define an input in a PageForms form you need to add the following wikitext: {{{field|mendeley title|input type=mendeley}}} This will show as two input fields - the first one will let you search for a document using autocomplete and the second one will auto-fill with the ID on selection of any document.

Examples

[edit]
  • This example displays the title of the document:

{{#mendeley:doi=10.1103/PhysRevA.20.1521|parameter=title}} → Laser cooling of atoms

  • First name of all authors:

{{#mendeley:id=04d48d5f-d664-3a17-b004-1503cca53802|parameter=authors;first_name}} → D. J.,Wayne M

  • Example to combine first and last names (Uses Variables extension):

{{#vardefine:i|0}}{{#arraymap:{{#mendeley:{{{doi|}}}|authors;last_name}}|,|xyz| :[[Author::{{#explode:{{#mendeley:{{{doi|}}}|authors;first_name}}|,|{{#var:i}}}} {{#explode:{{#mendeley:{{{doi|}}}|authors;last_name}}|,|{{#var:i}}}}]] {{#vardefine:i|{{#expr:{{#var:i}}+1}} }} |\n}}