Add FileIO interface for .bib files #47
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you for making this library!
Currently, importing from bib files or strings uses the same interface
import_bibtex
, but it is having an issue for me: For longer strings,isfile
function fails due toENAMETOOLONG
error. While this issue can be resolved easily with ad-hoc solutions, I am thinking that maybe utilizing https://github.com/JuliaIO/FileIO.jl package could make a unified IO interface.This PR is an attempt to implement interfaces required by FileIO for .bib files. If you think this is good, after it's merged, I will create a PR on the FileIO side to register this package for .bib files. I think it also serves as a good template to implement IO interfaces for other bibliography formats as well, such as .cff.
I added some tests to show that the functions actually work okay. The only issue is that I tried to validate bib contents by comparing the bib entries for equality, but even two consecutive reads of the same file do not produce entries that compare equal. However, I think this is a different issue and might better be discussed in
BibInternal.jl
.