Skip to content

Gizra/biblio

Repository files navigation

Build Status

Biblio

Biblio is used for importing and rendering bibliographies.

Installation

Upgrade from 1.x

  • Backup your existing DB!
  • Download Migrate (version 2.6-rc1 or higher), and enable Migrate UI
  • Download and enable Migrate extras
  • Replace the old biblio folder with the 3.x version
  • Execute update.php
  • Follow the steps from the above "Installation" section
  • In admin/content/migrate/configure click on Register statically-defined classes
  • In admin/content/migrate Select Biblio 3.x and Execute

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

About

Biblio 3.x module for Drupal 7

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages