GithubHelp home page GithubHelp logo

eleventy-plugin-bibtex's Introduction

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

eleventyConfig.addPairedShortcode(
  "bibtex", 
  require('eleventy-plugin-bibtex')
);

Nunjucks

eleventyConfig.addPairedAsyncShortcode(
    "bibtex",
    require("eleventy-plugin-bibtex")
);

Usage

In 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:

<div data-csl-entry-id="2" class="csl-entry">Kocher, P., Genkin, D., Gruss, D., Haas, W., Hamburg, M., Lipp, M., Mangard, S., Prescher, T., Schwarz, M., &amp; Yarom, Y. (2018). Spectre Attacks: Exploiting Speculative Execution. <i>ArXiv Preprint ArXiv:1801.01203</i>. <a href="https://arxiv.org/pdf/1801.01203" class="no-underline no-underline-url" target="_blank" rel="noopener noreferrer">https://arxiv.org/pdf/1801.01203</a></div>

Notes

  • If the output APA contains URLs, it will create actual a hrefs for them using Autolinker.js.

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

eleventy-plugin-bibtex's People

Contributors

savjee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

brunocbr

eleventy-plugin-bibtex's Issues

[object Promise] instead of rendering

Hi, thank you so much for creating this! It's exactly what I'm looking for.

I followed the setup instructions, but instead of getting the HTML for the citation, it's just displaying "[object Promise]" for each citation. Googling around it seems to have something to do with asynchronous loading, but I can't quite work out how to fix it. Any ideas would be wonderful!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.