Hey! I’m a longtime user of Zola. I also somewhat recently wrote the serde_bibtex
crate while yak shaving for some other project.
I saw that Zola internally uses nom-bibtex
, which seems to be in ‘maintenance mode’, and there are a few issues with the BibTeX handling in Zola which have been upstreamed but not implemented:
(Apologies for the lack of links but as a new poster apparently I cannot include more than 2)
Supporting non-numeric values in month field · Issue #26 · charlesvdv/nom-bibtex · GitHub
Support for special characters · Issue #13 · charlesvdv/nom-bibtex · GitHub
Currently (1) is already canonically supported by serde_bibtex
and I already have plans (because of downstream requirements in my other project) to implement support for some version of (2). For better or worse, (2) is quite a complex feature to implement since at its worst it is equivalent to parsing a subset of LaTeX, with all of the horror fun that this entails. In any case having universal support for (2) is quite beyond the scope of any reasonable library but it would not be too difficult to implement (rudimentary) support for many standard LaTeX-isms such as manual &
-escapes, accent mappings, and {}
stripping / recapitalization.
If there is interest I would be happy to migrate zola
to internally use serde_bibtex
. The migration would in principle be quite straightforward. The main benefit would be that I am quite happy to implement features upstream that would benefit Zola. There would also be some (minor) performance gains; for instance since Value
already implements Deserialize
one would skip the intermediate allocations. The parsing in serde_bibtex
is also reasonably performant.
Some (current) downsides might be that serde_bibtex
is somewhat unstable at the moment. Also the error messages are not the best right now; for instance currently there is no row/column reporting for syntax issues in the source file. However these are things that I plan to improve upstream in any case and this could certainly be done before actually migrating to serde_bibtex
.