parse

Cite. parse

Namespaces

bibtex
bibtxt
date
doi
input
util
wikidata

Members

(static, constant) exports.bibjson

Deprecated:
Source:

Methods

(protected, static) chain(input, optionsopt) → {Array.<CSL>}

Parse input until success.

Source:
Parameters:
Name Type Attributes Description
input InputData

input data

options Cite~InputOptions <optional>

options

Returns:
Type:
Array.<CSL>

The parsed input

(protected, static) chainAsync(input, optionsopt) → {Promise.<Array.<CSL>>}

Parse input until success. (async)

Source:
Parameters:
Name Type Attributes Description
input InputData

input data

options Cite~InputOptions <optional>

options

Returns:
Type:
Promise.<Array.<CSL>>

The parsed input

Parse input once.

Source:
Parameters:
Name Type Description
input InputData

input data

Returns:
Type:
Array.<CSL>

The parsed input

(protected, static) chainLinkAsync(input) → {Promise}

Parse input once. (async)

Source:
Parameters:
Name Type Description
input InputData

The input data

Returns:
Type:
Promise

The parsed input

(protected, static) parseCsl(data) → {Array.<CSL>}

Make CSL JSON conform to standards so that plugins don't have to typecheck all the time.

Source:
Parameters:
Name Type Description
data Array.<CSL>

Array of CSL

Returns:
Type:
Array.<CSL>

Array of clean CSL

(protected, static) parseDate(value) → {Object|Object}

Convert date to CSL date. Supported formats:

  • Epoch time (in number form)
  • YYYY-MM-DD
  • [+-]YYYYYY[Y...]-MM-DD
  • [DDD, ]DD MMM YYYY
  • M[M]/D[D]/YY[YY] (1)
  • D[D] M[M] Y[Y...] (2, 1)
  • [-]Y[Y...] M[M] D[D] (2)
  • D[D] MMM Y[Y...] (2)
  • [-]Y[Y...] MMM D[D] (2)
  • M[M] [-]Y[Y...] (3, 5)
  • [-]Y[Y...] M[M] (3, 4, 5)
  • MMM [-]Y[Y...] (3, 5)
  • [-]Y[Y...] MMM (3, 5)
  • [-]Y[Y...] (5)

Generally, formats support trailing parts, which are disregarded.

  1. When the former of these formats overlaps with the latter, the former is preferred
  2. " ", ".", "-" and "/" are all supported as separator
  3. Any sequence of non-alphanumerical characters are supported as separator
  4. This format is only assumed if the year is bigger than the month
  5. This format doesn't support trailing parts
Source:
Parameters:
Name Type Description
value Number | String

date in supported format, see above

Returns:
  • Type:
    Object

    Object with property "date-parts" with the value [[ YYYY, MM, DD ]]

  • Type:
    Object

    If unparsable, object with property "raw" with the inputted value

(protected, static) parseName(name) → {Object}

Get CSL from name

Source:
Parameters:
Name Type Description
name String

string

Returns:
Type:
Object

The CSL object