[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Upstreaming parsebib.el
From: |
Joost Kremers |
Subject: |
Upstreaming parsebib.el |
Date: |
Thu, 16 Jan 2025 17:09:57 +0100 |
User-agent: |
mu4e 1.12.8; emacs 29.4 |
Hi,
I maintain a package `parsebib`[1] for parsing .bib files, and recently,
Ihor Radchenko (Cc:'ed) suggested that it could be useful to upstream it.
The package is used by most (if not all) bibliography-related packages
available on MELPA, and Ihor feels it might be useful to have it in core,
to make it available to packages in core and on GNU ELPA, (possibly
including org-mode itself).
I'll let Ihor chime in with his motivations for making the initial
suggestion, but to make the case, a few things to note:
- `parsebib` is a library for parsing .bib files, i.e., it is not a major
mode for editing them. IOW, it's not user-facing, it's intended for
developers. (Also, it doesn't compete with `bibtex.el`.)
- There is, therefore, no machinery to check for the validity of a .bib
entry (e.g., whether the entry type is valid, whether all required fields
are present etc.) Syntactically incorrect entries *are* rejected, of
course.
- What `parsebib` does is read the contents of a .bib file and return it as
a hash table (plus, optionally some additional data structures).
- Optionally, entries can be 'prettified', which means that @String
abbreviations can be expanded, crossref's can be resolved (i.e., if an
entry has a crossref field, the contents of the cross-referenced entry is
added to the cross-referencing entry), and LaTeX commands can be removed
or replaced with something better-looking. (These prettifications aren't
applied to the .bib file, of course: they're meant for displaying the
.bib entries to the user.)
- The parser is a recursive-descent parser.[2]
- `parsebib` can also parse CSL-JSON files (using Emacs' built-in JSON
support).
One question that would arise is obviously compatibility with `bibtex.el`.
`parsebib` tends to favour biblatex over BibTeX, which IIUC, is not the
case for `bibtex.el` (CC: Roland Winkler).
>From a copyright point of view: most of the code is mine, and I have signed
the copyright assignment form. The code that handles prettifying LaTeX code
comes from two other contributors, who both have signed copyright
assignments as well. There are several smaller contributions, which,
however, appear to fall under the 15 LOC limit. (Though obviously that
would need to be reviewed more thoroughly.)
WDYallT?
Joost
Footnotes:
[1] https://github.com/joostkremers/parsebib
[2] It's my first attempt at writing an RDP, so it's probably not as
optimised as it can be. That's something I could work on.
--
Joost Kremers
Life has its moments
- Upstreaming parsebib.el,
Joost Kremers <=