Skip to content

Reverse the order of bib entries #38

@JinraeKim

Description

@JinraeKim

Related to #36.

What should I do to reverse the order of the OrderedDict of bib entries?

For example,

julia> bib = Bibliography.import_bibtex(joinpath("references", file * ".bib"))
OrderedCollections.OrderedDict{String, BibInternal.Entry} with 4 entries:
  "kimNeuralNetworkBasedPathReplanning2021"         => Entry(Access("10.1109/ACCESS.2021.3083734", "", "https://ieeexplore.ieee.org/document/9440908"), BibInternal.Name[Name("", "Kim", "", "Jinrae", ""), Name("", "Lee", "", "Suwon", ""), Name("", "Lee", "", "Sangmin", ""), Name("
  "kimPartiallyConvexNeuralNetworks_in_preparation" => Entry(Access("", "", ""), BibInternal.Name[Name("", "Kim", "", "Jinrae", ""), Name("", "Kim", "", "Youdan", "")], "", Date("", "", "2099"), BibInternal.Name[], Eprint("", "", ""), "kimPartiallyConvexNeuralNetworks_in_preparat
  "kimFieldofViewConstrainedImpactAngle2021"        => Entry(Access("10.1177/0954410020942010", "", "http://journals.sagepub.com/doi/10.1177/0954410020942010"), BibInternal.Name[Name("", "Kim", "", "Jinrae", ""), Name("", "Cho", "", "Namhoon", ""), Name("", "Kim", "", "Youdan", "
  "choWindCompensationFramework2020a"               => Entry(Access("10.1109/TAES.2019.2920219", "", "https://ieeexplore.ieee.org/document/8727399/"), BibInternal.Name[Name("", "Cho", "", "Namhoon", ""), Name("", "Lee", "", "Suwon", ""), Name("", "Kim", "", "Jinrae", ""), Name(""

julia> sort_bibliography!(bib, :y)
OrderedCollections.OrderedDict{String, BibInternal.Entry} with 4 entries:
  "choWindCompensationFramework2020a"               => Entry(Access("10.1109/TAES.2019.2920219", "", "https://ieeexplore.ieee.org/document/8727399/"), BibInternal.Name[Name("", "Cho", "", "Namhoon", ""), Name("", "Lee", "", "Suwon", ""), Name("", "Kim", "", "Jinrae", ""), Name(""
  "kimNeuralNetworkBasedPathReplanning2021"         => Entry(Access("10.1109/ACCESS.2021.3083734", "", "https://ieeexplore.ieee.org/document/9440908"), BibInternal.Name[Name("", "Kim", "", "Jinrae", ""), Name("", "Lee", "", "Suwon", ""), Name("", "Lee", "", "Sangmin", ""), Name("
  "kimFieldofViewConstrainedImpactAngle2021"        => Entry(Access("10.1177/0954410020942010", "", "http://journals.sagepub.com/doi/10.1177/0954410020942010"), BibInternal.Name[Name("", "Kim", "", "Jinrae", ""), Name("", "Cho", "", "Namhoon", ""), Name("", "Kim", "", "Youdan", "
  "kimPartiallyConvexNeuralNetworks_in_preparation" => Entry(Access("", "", ""), BibInternal.Name[Name("", "Kim", "", "Jinrae", ""), Name("", "Kim", "", "Youdan", "")], "", Date("", "", "2099"), BibInternal.Name[], Eprint("", "", ""), "kimPartiallyConvexNeuralNetworks_in_preparat

But I wanna get the reverse-ordered result.

Even if there is a simple way of reversing the order of an OrderedDict, I think it would be much convenient if a keyword argument is provided for "reversing the order".

Current sorting rules look like:

const sorting_rules = Dict{Symbol, Vector{Symbol}}(
    :nty  => [:authors;:editors;:title;:date],
    :nyt  => [:authors;:editors;:date;:title],
    :y    => [:date]
);

so maybe we need something like

:nty
:n-ty  # reverse only t
:-y  # reverse y
...  # etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions