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

tree-sitter-biber

v0.6.3

Published

Tree sitter grammar for biber

Downloads

5

Readme

tree-sitter-biber

Build Status Build status

Tree sitter parser for .bib files using biber syntax. This is subtly different to the original bibtex syntax, but largely similar.

The main differences are how comments are handled. For bibtex, anything outside an @ entry or command is a proper comment. In biber, this is also a comment but is considered "junk" (and warns you appropriately in the log file). Instead, biber requires % to consider a line a proper comment.

Similarly, the comment command is also treated differently. In bibtex, the parsing of the command stops immediately after @comment. So @comment{this is a comment} is equivalent to @comment this is a comment, because neither sentences are considered inside a command or entry. In contrast, biber will grab the entire body, and throw an error if it doesn't exist. I.e., @comment this is an error will throw because biber is expecting an opening delimiter (brace or parenthesis).

Here's a scenario where this may be relevant in real life:

@comment{email me at [email protected]}

biber will be fine, but bibtex will throw an error (because the entry domain has no valid opening delimiter).

And, to be fair to bibtex, this will break biber but not bibtex:

@comment{ { }

More can be found here https://tex.stackexchange.com/questions/261261/are-comments-discouraged-in-a-bibtex-file/262282

Importantly, % is always a comment outside of a string in biber. So another real life difference is

@ARTICLE{auchunbekannt,
  title = {Beispielaufsatz},
  journal = {Zeitschrift},
  year = {2001},
  %volume = {7},
  pages = {1--35, 99--291},
  annotation = {lorem},
}

where bibtex will throw an error, but biber just considers the volume line to be a comment.

Similarly,

@BOOK(Car%ey,
,
  AUTHOR="G. V. Carey",
  TITLE="Mind the Stop: A Brief Guide to Punctuation", PUBLISHER="Penguin",
  YEAR="1958"
)

The extra comma is necessary for biber, and the key name is Car. For bibtex, the extra comma throws a "missing a field" error, but the key is completely valid (though good luck referencing it in the document).

Note that special TeX characters inside of entries, besides ones biber (and bibtex) actually looks for, are effectively ignored. So it is not really possible to accurately parse the contents of a string, nor desirable for a faithful parser. If you have an unescaped % in the string, it will break when the citation is used in a document (but is completely valid biber syntax).

This answer also does a good job of explaining what the actual terms bibtex, biber, natbib, and biblatex actually refer to. https://tex.stackexchange.com/questions/25701/bibtex-vs-biber-and-biblatex-vs-natbib