Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncited Items API #67

Merged
merged 14 commits into from
Sep 18, 2020
Merged

Uncited Items API #67

merged 14 commits into from
Sep 18, 2020

Conversation

cormacrelf
Copy link
Collaborator

In sum:

driver.includeUncited("None"); // Default
driver.includeUncited("All");
driver.includeUncited({ Specific: ["citekeyA", "citekeyB"] });

If a reference, known to the driver, is not cited in any of the clusters in the document, it can still be included in the bibliography if it matches the filter set by includeUncited().

This has been tested especially in the context of disambiguating using those uncited items. It lacks an actual test suite to confirm that, but the matter is almost entirely whether those items participate or not.

Also:

  • Actually creates "ghost cites" of uncited items for disambiguation
  • Finally allocates year-suffixes in bibliography order, per the spec, which
    can be different from cited order
  • Uses pristine ghost cites, even for cited items, when forming year-suffix
    groups. Because "ibid" references can match more items' DFAs than they
    should. See that "Alloc year suffixes" commit for details.
  • Workaround for some mutex issues that I have now solved (subsequent PR)

… cites.

The bib order is per the spec, a long-standing TODO in year_suffixes().
Using ghost cites for every single reference is a new tactic, to avoid
the following case where @A and @b need a year suffix but @c is different:

uncited: @b, @c
---
@A
@A
@A

Here, the second @A is ibid, and only renders "ibid.". However, this cite
will be accepted by all three DFAs. So previously, the bibliography would
have a year suffix added to all three entries, simply because an ibid cite
in the document, not expected to be able to be disambiguated, matched each.

New code only using ghost cites (which are always First) means that these
suffixes are based on the most ideal representation of the reference.
@cormacrelf cormacrelf merged commit e088424 into master Sep 18, 2020
@cormacrelf cormacrelf added A-wasm Area: wasm package on npm A-core Area: affects all builds of citeproc-rs enhancement New feature or request A-crates/citeproc Area: citeproc crate A-crates/csl Area: csl crate labels Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: affects all builds of citeproc-rs A-crates/citeproc Area: citeproc crate A-crates/csl Area: csl crate A-wasm Area: wasm package on npm enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

None yet

1 participant