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
- Host: GitHub
- URL: https://github.com/savjee/eleventy-plugin-bibtex
- Owner: Savjee
- License: mit
- Created: 2021-05-19T07:25:25.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-09-20T11:28:35.000Z (almost 2 years ago)
- Last Synced: 2025-02-14T09:42:43.861Z (over 1 year ago)
- Language: JavaScript
- Size: 31.3 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.