Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
fix(citation): move locators to CiteRef
Browse files Browse the repository at this point in the history
In #138, I accidentally made the change to the citation suffix, rather
than where it belonged: the citation-reference.

This corrects that.

As with org-cite, this citation model has global and by-reference
affixes.

Locators only apply to the latter.

Signed-off-by: Bruce D'Arcus <bdarcus@gmail.com>
  • Loading branch information
bdarcus committed May 24, 2023
1 parent 2d9b5f8 commit d06a103
Showing 1 changed file with 4 additions and 29 deletions.
33 changes: 4 additions & 29 deletions src/citation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export type Citation = {
// richer than CSL 1.0, but matches biblatex/org-cite
prefix?: string;
/**
* An array of locator key-values and/or strings.
* A string that follows a list of citation references.
*/
suffix?: Locator[];
suffix?: string;
references: CiteRef[];
};

Expand All @@ -37,32 +37,7 @@ export type CiteRef = {
*/
refID: ID;
/**
* A string that follows the citation reference.
*
* CSL styles recognize "locator" in citation references' suffix. For example, in the citation
*
* [cite:see @Tarski-1965 chapter 1, for an example]
*
* "chapter 1" is the locator. The whole citation is rendered as
*
* (see Tarski 1965, chap. 1 for an example)
*
* in the default CSL style.
*
* The locator starts with a locator term listed in the LocatorTerms type.
* The locator term is followed by a space and then the locator value.
* The locator value is a string of numbers and/or letters.
* The locator value may be discontinuous, in which case it is separated by commas. For example, "23, 25-36"
* is a discontinuous locator value.
*
* The part of the suffix before the locator is appended to reference's prefix.
* If no locator term is used, but a number is present, then "page" is assumed.
*
* Adapted from org-mode.
*
* See also https://pandoc.org/MANUAL.html#extension-citations
* An array of locator key-values and/or strings.
*/
// REVIEW: the above will fail in some cases, with pandoc syntax offering a fail safe of sorts.
// An alernative, more robust, approach is to use a structured array, as in the v1.1 branch.
suffix?: string;
suffix?: Locator[];
};

0 comments on commit d06a103

Please sign in to comment.