Class: Cite

Cite

new Cite(data, options)

Create a Cite object with almost any kind of data, and manipulate it with its default methods.

Parameters:
Name Type Description
data String | CSL | Object | Array.<String> | Array.<CSL> | Array.<Object>

Input data. If no data is passed, an empty object is returned

options Object

The options for the output. See input options.

Source:

Members

(protected, static) this._options :Object

The default options for the output. See input options

Type:
  • Object
Default Value:
  • {}
Source:

(protected, static) this.data :Object

The data formatted to JSON

Type:
  • Object
Default Value:
  • []
Source:

(protected, static) this.log :Array.<Object>

The log, containing all logged data, consisting of copies of the Cite object at different moments in time.

The .reset() function does not reset on the log. This way, you can still undo all changes.



.currentVersion() and similar function are not logged, because this would be influenced by function using other functions.

Type:
  • Array.<Object>
Properties:
Name Type Description
0 Cite

The first image.

Source:

Methods

(static) add(data, log) → {Cite}

Add an object to the array of objects

This:
Parameters:
Name Type Description
data String | CSL | Object | Array.<String> | Array.<CSL> | Array.<Object>

The data to add to your object

log Boolean

Show this call in the log

Source:
Returns:

The updated parent object

Type
Cite

(static) currentVersion() → {Number}

This:
Source:
Returns:

The latest version of the object

Type
Number

(static) get(options) → {String|Array.<Object>}

Get formatted data from your object. For more info, see Output.

This:
Parameters:
Name Type Description
options Object

The options for the output. See input options

Properties
Name Type Attributes Description
locale String <optional>

Custom CSL locale for citeproc

template String <optional>

Custom CSL style template for citeproc

Source:
Returns:

The formatted data

Type
String | Array.<Object>

(static) getIds() → {Array.<String>}

Get a list of the data entry IDs, in the order of that list

This:
Source:
Returns:

List of IDs

Type
Array.<String>

(static) options(options, log) → {Cite}

Change the default options of a Cite object.

This:
Parameters:
Name Type Description
options Object

The options for the output. See input options

log Boolean

Show this call in the log

Source:
Returns:

The updated parent object

Type
Cite

(static) reset(log) → {Cite}

Reset a Cite object.

This:
Parameters:
Name Type Description
log Boolean

Show this call in the log

Source:
Returns:

The updated, empty parent object (except the log, the log lives)

Type
Cite

(static) retrieveVersion(versnum) → {Cite}

Returns an image of the object in the version specified.

This:
Parameters:
Name Type Description
versnum Number

The number of the version you want to retrieve. Illegel numbers: numbers under zero, floats, numbers above the current version of the object.

Source:
Returns:

The version of the object with the version number passed. undefined if an illegal number is passed.

Type
Cite

(static) save() → {Cite}

Save an image of the current version of the object.

This:
Source:
Returns:

The current version of the object.

Type
Cite

(static) set(data, log) → {Cite}

Recreate a Cite object with almost any kind of data, and manipulate it with its default methods.

This:
Parameters:
Name Type Description
data String | CSL | Object | Array.<String> | Array.<CSL> | Array.<Object>

The data to replace the data in your object

log Boolean

Show this call in the log

Source:
Returns:

The updated parent object

Type
Cite

(static) sort(log) → {Cite}

Sort the datasets alphabetically, on basis of it's BibTeX label

This:
Parameters:
Name Type Description
log Boolean

Show this call in the log

Source:
Returns:

The updated parent object

Type
Cite

(static) undo(numberopt) → {Cite}

Returns the second to last saved image of the object.

This:
Parameters:
Name Type Attributes Default Description
number Number <optional>
1

number of versions to go back.

Source:
Returns:

The second to last version of the object. undefined if used on first version.

Type
Cite

(static) undo() → {Cite}

Returns the last saved image of the object.

This:
Source:
Returns:

The last version of the object. undefined if used on first version.

Type
Cite

Type Definitions

asyncCite(data)

Parameters:
Name Type Description
data Cite

Cite object

Source:

retrieveItem(id) → {CSL}

Parameters:
Name Type Description
id String

Citation id

Source:
Returns:

CSL Citation object

Type
CSL

retrieveLocale(lang) → {String}

Parameters:
Name Type Description
lang String

Language code

Source:
Returns:

CSL Locale

Type
String