BibTeX.jl icon indicating copy to clipboard operation
BibTeX.jl copied to clipboard

[WIP] add function parse_bibtex_ordered

Open asinghvi17 opened this issue 5 years ago • 6 comments

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.

asinghvi17 avatar May 22 '19 16:05 asinghvi17

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"=…

asinghvi17 avatar May 22 '19 16:05 asinghvi17

Should this just be the default?

stevengj avatar May 27 '19 01:05 stevengj

Why not use an OrderedDict from OrderedCollections.jl?

simonbyrne avatar May 29 '19 04:05 simonbyrne

Or if not that, an array of Pairs, as that can be easily converted into a Dict, OrderedDict, etc.

simonbyrne avatar May 29 '19 04:05 simonbyrne

I am in favor of OrderedDict (I did it on my "fork", and it is just a matter of changing one Dict to OrderedDict)

Azzaare avatar Jul 19 '20 04:07 Azzaare

Should we go ahead an merge this?

mykelk avatar May 31 '21 22:05 mykelk