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

bibcite

v1.0.0

Published

Citations with Bibliography

Downloads

35

Readme

Bibcite

BibTeX or BibLaTeX like citation for HTML.

Brand new and (probably) full of bugs

Browser Usage

  1. Export your library from your favorite reference management software (e.g. Zotero) in the CSL-JSON format (Detailed Explanation).

  2. Obtain the Javascript file of Bibcite (e.g. from JSDelivr)

  3. Assuming you have an exported csl-json file, which we are going to call references.json from now on (but you can use any other filename). And a link to the JS file of bibcite (here called bibcite.js) you can do the following in an html file

    <head>
      <script src="bibcite.js"></script>
      <bib-config bib="references.json"></bib-config>
    </head>
    <body>
      <p>
        This is an example of parenthical citation:
        <bib-cite key="id in references.json"></bib-cite>
      </p>
    
      <bib-references></bib-references>
    </body>

Configuration Options

  1. At the moment there are two citation-styles alphabetic(default) and numeric you can select them like this:

    <bib-config bib="references.json" citation-style="numeric"></bib-config>
  2. There are three types of citations inspired by BibLaTeX \textcite, \parencite and \rawcite. You can set the type of bib-cite to either paren-cite (default) text-cite or raw-cite, e.g.

    <bib-cite key="id_key" type="text-cite"></bib-cite>

Node Module

You can find bibcite on npm.

Custom Styles

There will be a way to do customization in the future. Styles are Typescript types

type CiteStyle = {
  name: string;
  order: BibOrder;
  enclosing: [string, string];
  multiSeparator: string;
  identifier: (index: number, bib_data: Data, citeType: CiteType) => string;
  bib_entry: (index: number, bib_data: Data) => string;
  reference: (content: string) => string;
};

so the numeric style for example is implemented like this:

export const numeric: CiteStyle = {
  name: "numeric",
  order: { comparison: insertion, inform_citations: true },
  enclosing: ["[", "]"],
  multiSeparator: ",",
  identifier: (index: number, _: Data) => String(index),
  bib_entry: (index: number, bib_data: Data) => `
    <tr>
      <td>[${index}]</td>
      <td>
        <h3>${bib_data.title}</h3>
        <span>${bib_data.author.map((p) => p.family).join(", ")}</span>
        <span>(${bib_data.issued["date-parts"][0][0]})</span>
      </td>
    </tr>
  `,
  reference: (content: string) =>
    `<h2>References</h2>
  <table>
    ${content}
  </table>
  `,
};

I still need to figure out how to do plugin loading here though.