BibTeX.jl
BibTeX.jl copied to clipboard
[WIP] add function parse_bibtex_ordered
Adds a function parse_bibtex_ordered
, which, instead of returning a Dict of Dicts, returns an Array of Dicts. This may be useful for determination of primacy in the CITATION.bib file format.
using BibTeX
preamble, result = read(joinpath(pathof(BibTeX) |> dirname |> dirname, "example", "examples.bib"), String) |> parse_bibtex_ordered
result[1]
Dict{String,Dict{String,String}} with 1 entry:
"westfahl:space" => Dict("crossref"=>"westfahl:frontier","indextitle"=>"True Frontier , The","author"=>"Westfahl , Gary","pages"=>"55-65","langidopts"=>"variant = american","langid"=>"english","title"=>"The True Frontier","annotation"=…
Should this just be the default?
Why not use an OrderedDict from OrderedCollections.jl?
Or if not that, an array of Pair
s, as that can be easily converted into a Dict
, OrderedDict
, etc.
I am in favor of OrderedDict (I did it on my "fork", and it is just a matter of changing one Dict to OrderedDict)
Should we go ahead an merge this?