Gizra / biblio

Biblio 3.x module for Drupal 7
23 stars 6 forks source link

Build Status

Biblio

Biblio is used for importing and rendering bibliographies.

Installation

Upgrade from 1.x

Congrats, your Biblio installation is now upgraded to 3.x

Render Biblio API

// Loading the biblio.
$biblio_bid = 1;
$biblio = bilbio_load($biblio_bid);

// Specify the style in which you wish the output to be.
// In this example, we want it to be in BibTex style.
$biblio_style = 'bibtex';

// Render the biblio.
$biblio->getText($biblio_style);

Import Biblio API

// The data you wish to import.
// In this example it is a book.
$data = '
@Book{washington+franklin,
  author    = "George {Washington} and Benjamin {Franklin}",
  title     = "Book About the USA",
  publisher = "ABC",
  year      =  1980,
  address   = "Los Angeles",
  edition   = "ninth ABC printing, tenth DEF printing"
}';

// Get the relevant biblio style class to handle the information.
$biblio_style = biblio_get_class_from_style('bibtex')

// Import the Biblios.
$biblios = $biblio_style->import($data);

Adding Contributors

Contributors can be added using the Biblio::addContributors helper method.

// Biblio Contributors' names.
$biblio = biblio_create('book');

// Add multiple authors.
$biblio->addContributors('John Doe and Ploni Almoni');

// Add an editor.
$biblio->addContributors('John Smith', 'Editor');

CiteProc

Styles can now be rendered using CiteProc, for example:

  $biblio = biblio_create('journal');
  $biblio->getText('citeproc', array('style_name' => 'ama'));
  $biblio->getText('citeproc');

Example module

For more useful examples, we recommend enabling the module biblio_example.

Credits

The 3.x version is developed by Gizra and sponsored by Harvard OpenScholar