npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bibliography

v0.1.0

Published

Library for parsing and rendering bibliographic entities (ie. convert to and from BibTex, AMA reference, etc)

Downloads

105

Readme

bibliography

Build Status Coverage npm version dependencies dev dependencies License

Library for parsing and rendering bibliographic entities.

The library can parse BiBTeX files and render them to React components. Some light processing is done, such as replacing special characters with their Unicode equivalent (for example, {\"o} is automatically converted to ö), but general LaTeX commands are currently not processed.

Getting Started

Install it via npm:

npm install bibliography

And include in your project:

import bibliography from 'bibliography';

Usage

To render the following AMA style reference:

Navarro P, Chambers I, Karwacki-Neisius V, et al. Molecular coupling of Xist regulation and pluripotency. Science. 2008;(321):1693-1695. http://www.sciencemag.org/cgi/content/full/321/5896/1693. Accessed June 4, 2009.

    import React from 'react'
    import Bibliography, {parseString} from 'bibliography'
    import AMA from 'bibliography/AMA'

    // file.bib
    var bib_article = "@article{navarro2008molecular,\n"
        + "title={Molecular coupling of Xist regulation and pluripotency},\n"
        + "author={Navarro, Pablo and Chambers, Ian and Karwacki-Neisius, Violetta and Chureau, Corinne and Morey, C{\'e}line and Rougeulle, Claire and Avner, Philip},\n"
        + "journal={Science},\n"
        + "volume={321},\n"
        + "number={5896},\n"
        + "pages={1693--1695},\n"
        + "year={2008},\n"
        + "url={http://www.sciencemag.org/cgi/content/full/321/5896/1693},\n"
        + "urldate={2009-06-04},\n"
        + "publisher={American Association for the Advancement of Science}\n"
        + "}";
    // Parse bibliography string
    const bibliography = parseString(bib_article);

    const markup = ReactDOMServer.renderToStaticMarkup(<AMA entry={bibliography.entries['navarro2008molecular']}/>);

    // Renders <span class="_bib_citation _bib_ama _bib_article" id="navarro2008molecular" itemscope="" itemtype="https://schema.org/CreativeWork"><span class="_bib_authors_wrapper"><span class="_bib_authors"><span itemprop="author" itemscope="" itemtype="https://schema.org/Person" class="_bib_author"><span itemprop="name"><span itemprop="familyName">Navarro</span> P</span></span>, <span itemprop="author" itemscope="" itemtype="https://schema.org/Person" class="_bib_author"><span itemprop="name"><span itemprop="familyName">Chambers</span> I</span></span>, <span itemprop="author" itemscope="" itemtype="https://schema.org/Person" class="_bib_author"><span itemprop="name"><span itemprop="familyName">Karwacki-Neisius</span> V</span></span>, et al</span>.</span> <span class="_bib_title_wrapper"><cite class="_bib_title" itemprop="name">Molecular coupling of Xist regulation and pluripotency</cite>.</span> <span class="_bib_journal"><span><cite itemscope="" itemtype="https://schema.org/Periodical" itemid="#_bib_journal_Science" class="_bib_journal"><span itemprop="name">Science</span></cite>.</span> <span itemprop="isPartOf" itemscope="" itemtype="http://schema.org/PublicationIssue"><span itemprop="datePublished" datetime="2008" class="_bib_year">2008</span>;(<span itemprop="isPartOf" itemscope="" itemtype="https://schema.org/PublicationVolume" class="_bib_volume"><span itemprop="volumeNumber">321</span><link itemprop="isPartOf" href="#_bib_journal_Science"/></span>):<span class="_bib_pages"><span itemprop="pageStart">1693</span>-<span itemprop="pageEnd">1695</span></span>.</span></span> <span class="_bib_url"><a itemprop="url" href="http://www.sciencemag.org/cgi/content/full/321/5896/1693">http://www.sciencemag.org/cgi/content/full/321/5896/1693</a>.</span> <span class="_bib_access_date">Accessed <span datetime="2009-06-04">June 4, 2009</span>.</span></span>
    console.log(markup);

License

MIT