martinec / grav-plugin-bibtexify

The BibTeXify plugin for Grav turn a list of BibTeX references into an interactive page
MIT License
9 stars 4 forks source link
bibtex citations grav publications

Grav BibTeXify Plugin

About

The BibTeXify plugin for Grav makes it trivial to create interactive publications lists with JavaScript and BibTeX using bib-publication-list.

Installation

Typically a plugin should be installed via GPM (Grav Package Manager):

$ bin/gpm install bibtexify

Alternatively it can be installed via the Admin Plugin

Manual Installation

To install this plugin, just download the zip version of this repository and unzip it under /your/site/grav/user/plugins. Then, rename the folder to bibtexify. You can find these files on GitHub or via GetGrav.org.

You should now have all the plugin files under

/your/site/grav/user/plugins/bibtexify

NOTE: This plugin is a modular component for Grav which requires Grav Shortcode Core Plugin to operate.

Configuration Defaults

As this plugin requires the Shortcode Core functionality there are some configuration options there that will effect this one. For example setting the default active state to false will also cause this plugin to not function.

Usage

This plugin provides the [bibtexify] shortcode. This is an example that shows off how you can easily turn a list of BibTeX references into a interactive page:

[bibtexify hideMissing=true]
@InBook{Gross1994,
  pages     = {2195--2205},
  title     = {The Encyclopedia of Language and Linguistics},
  publisher = {Oxford/NewYork/Seoul/Tokyo: Pergamon},
  year      = {1994},
  author    = {Gross, Maurice},
  editor    = {Ashley, R.E.},
  url       = {http://kybele.psych.cornell.edu/~edelman/TAU-05/Gross-french-lexicon-94.pdf},
}

@Article{Gross1998,
  author  = {Gross, Maurice},
  title   = {La fonction sémantique des verbes supports},
  journal = {Travaux de linguistique},
  year    = {1998},
  volume  = {37},
  pages   = {25--46},
  url     = {http://cat.inist.fr/?aModele=afficheN&cpsidt=2019110},
}

@Article{Gross2001b,
  author    = {Gross, Maurice},
  title     = {Les ambiguïtés},
  journal   = {Lingvisticae Investigationes},
  year      = {2001},
  volume    = {24},
  number    = {1},
  pages     = {3--41},
  publisher = {Amsterdam/Philadelphia : Benjamins},
  url       = {http://cat.inist.fr/?aModele=afficheN&cpsidt=13543081},
}
[/bibtexify]

This will be converted into the following:

BibTeXify Options

The [bibtexify] shortcode accepts the options available for bib-publication-list. Options can be passed as attributes of the shortcode, a summary of the current ones appears below:

visualizationA boolean to control addition of the visualization. Defaults to true.
tweetTwitter username to add Tweet links to bib items with a url field.
sortingControl the default sorting of the list. Defaults to `[[0, "desc"], [1, "desc"]]`. See (https://legacy.datatables.net/api#fnSort) for details on formatting.
datatablePass options to the datatable library used to create the table of publications. See (https://legacy.datatables.net/api) for available options.
defaultYearEntries without a year will use this as year. Defaults to "To Appear".
hideMissingA boolean to control when the missing mentions of a reference are visible. This option is not avalaible on the original bib-publication-list. Defaults to false.

Cookbook

Show only the first n authors

Starting v1.2.0, this can be achieved using CSS.

.bibtexify-authors li {
  display:none;
}

.bibtexify-authors li:nth-child(-n+2) {
  display: inline;
}

.bibtexify-authors .bibtexify-author-etal:before {
  content: ", et al.";
}

Known issues

Credits

This plugin use a forked version of bib-publication-list. The bib-publication-list author is vkaravir.