Cite

Cite

new Cite(data, optionsopt)

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

Source:
Parameters:
Name Type Attributes Default Description
data Cite~InputData

Input data

options Cite~InputOptions <optional>
{}

Input options

Namespaces

CSL
output
parse
util
version

Members

(constant) defaultOptions

Properties:
Name Type Description
defaultOptions Cite~OutputOptions

default output options

Source:

Methods

(static) async(data, optionsopt, callbackopt) → {Promise.<Cite>}

Source:
Parameters:
Name Type Attributes Default Description
data Cite~InputData

input data

options Cite~InputOptions <optional>
{}

cite options

callback Cite~asyncCallback <optional>

if not given, function returns promise.

Returns:
Type:
Promise.<Cite>

if callback is omitted, returns a promise

(static) validateOptions() → {Boolean}

Source:
To Do:
  • check registers if type is present
Parameters:
Type Description
Cite~InputOptions

options

Returns:
Type:
Boolean

true (if valid)

(static) validateOutputOptions() → {Boolean}

Source:
To Do:
  • check registers if styles and langs are present
Parameters:
Type Description
Cite~OutputOptions

options

Returns:
Type:
Boolean

true (if valid)

add(data, optionsopt, logopt) → {Cite}

Add an object to the array of objects

Source:
Parameters:
Name Type Attributes Default Description
data Cite~InputData

The data to add to your object

options Object <optional>
{}

Options

log Boolean <optional>
false

Show this call in the log

Returns:
Type:
Cite

The updated parent object

(async) addAsync(data, optionsopt, logopt) → {Promise.<Cite>}

Add an object to the array of objects

Source:
Parameters:
Name Type Attributes Default Description
data Cite~InputData

The data to add to your object

options Object <optional>
{}

Options

log Boolean <optional>
false

Show this call in the log

Returns:
Type:
Promise.<Cite>

The updated parent object

currentVersion() → {Number}

Source:
Returns:
Type:
Number

The latest version of the object

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

Get formatted data from your object.

Source:
Tutorials:
Parameters:
Name Type Attributes Default Description
options Cite~OutputOptions <optional>
{}

Output options

Returns:
Type:
String | Array.<Object>

The formatted data

getIds() → {Array.<String>}

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

Source:
Returns:
Type:
Array.<String>

List of IDs

options(options, logopt) → {Cite}

Change the default options of a Cite object.

Source:
Parameters:
Name Type Attributes Default Description
options Cite~OutputOptions

The options for the output

log Boolean <optional>
false

Show this call in the log

Returns:
Type:
Cite

The updated parent object

reset(logopt) → {Cite}

Reset a Cite object.

Source:
Parameters:
Name Type Attributes Default Description
log Boolean <optional>
false

Show this call in the log

Returns:
Type:
Cite

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

retrieveLastVersion() → {Cite}

Returns the last saved image of the object.

Source:
Returns:
Type:
Cite

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

retrieveVersion(versnumopt) → {Cite}

Returns an image of the object in the version specified.

Source:
Parameters:
Name Type Attributes Default Description
versnum Number <optional>
1

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

Returns:
Type:
Cite

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

save() → {Cite}

Save an image of the current version of the object.

Source:
Returns:
Type:
Cite

The current version of the object.

set(data, optionsopt, logopt) → {Cite}

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

Source:
Parameters:
Name Type Attributes Default Description
data Cite~InputData

Replacement data

options Object <optional>
{}

Options

log Boolean <optional>
false

Show this call in the log

Returns:
Type:
Cite

The updated parent object

(async) setAsync(data, optionsopt, logopt) → {Promise.<Cite>}

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

Source:
Parameters:
Name Type Attributes Default Description
data Cite~InputData

Replacement data

options Object <optional>
{}

Options

log Boolean <optional>
false

Show this call in the log

Returns:
Type:
Promise.<Cite>

The updated parent object

sort(methodopt, logopt) → {Cite}

Sort the dataset

Source:
Parameters:
Name Type Attributes Default Description
method Cite~sort | Array.<String> <optional>
[]

How to sort

log Boolean <optional>
false

Show this call in the log

Returns:
Type:
Cite

The updated parent object

undo(numberopt) → {Cite}

Returns the second to last saved image of the object.

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

number of versions to go back.

Returns:
Type:
Cite

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

Type Definitions

asyncCallback(data)

Source:
Parameters:
Name Type Description
data Cite

Cite object

InputOptions

Citation.js Input Options

Properties:
Name Type Description
output Cite~OutputOptions
maxChainLength Number
generateGraph Boolean
forceType Cite.parse~format
Source:
Tutorials:
Type:
  • Object

OutputOptions

Citation.js Ouput Options

Properties:
Name Type Description
format String
type String
style String
lang String
prepend String | Cite~wrapper
append String | Cite~wrapper
Source:
Tutorials:
Type:
  • Object

sort(a, b) → {Number}

Source:
Parameters:
Name Type Description
a CSL

element a

b CSL

element b

Returns:
Type:
Number

positive for a > b, negative for b > a, zero for a = b

wrapper(data) → {String}

Source:
Parameters:
Name Type Description
data CSL

Cite object

Returns:
Type:
String

wrapping string