An open API service indexing awesome lists of open source software.

https://github.com/savjee/eleventy-plugin-bibtex

Converts Bibtex references to APA notation in HTML
https://github.com/savjee/eleventy-plugin-bibtex

Last synced: 8 months ago
JSON representation

Converts Bibtex references to APA notation in HTML

Awesome Lists containing this project

README

          

# eleventy-plugin-bibtex

Converts Bibtex references to APA notation in HTML

## Installation
Install with npm:

```
npm install --save-dev eleventy-plugin-bibtex
```

## Eleventy configuration
Add to your `.eleventy.js` config file (depending on the template language you use).

**Liquid**
```js
eleventyConfig.addPairedShortcode(
"bibtex",
require('eleventy-plugin-bibtex')
);
```

**Nunjucks**
```js
eleventyConfig.addPairedAsyncShortcode(
"bibtex",
require("eleventy-plugin-bibtex")
);
```

## Usage
In Liquid:

```liquid
{% bibtex %}
@article{kocher2018spectre,
title={Spectre Attacks: Exploiting Speculative Execution},
author={Kocher, Paul and Genkin, Daniel and Gruss, Daniel and Haas, Werner and Hamburg, Mike and Lipp, Moritz and Mangard, Stefan and Prescher, Thomas and Schwarz, Michael and Yarom, Yuval},
journal={arXiv preprint arXiv:1801.01203},
year={2018},
url={https://arxiv.org/pdf/1801.01203},
}
{% endbibtex %}
```

Will output:

```html

Kocher, P., Genkin, D., Gruss, D., Haas, W., Hamburg, M., Lipp, M., Mangard, S., Prescher, T., Schwarz, M., & Yarom, Y. (2018). Spectre Attacks: Exploiting Speculative Execution. ArXiv Preprint ArXiv:1801.01203. https://arxiv.org/pdf/1801.01203

```

## Notes

* If the output APA contains URLs, it will create actual `a hrefs` for them using [Autolinker.js](https://github.com/gregjacobs/Autolinker.js).

* Bibtex requires unique IDs for all citations. This plugin does not require that, so be aware of possible duplicates.