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
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. |
(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> |
{} | |
log |
Boolean
|
<optional> |
false |
Show this call in the log |
(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> |
{} | |
log |
Boolean
|
<optional> |
false |
Show this call in the log |
currentVersion() → {Number}
- Source:
Returns:
- Type:
-
Number
The latest version of the object
format(format, …options) → {String|Arrat.<Object>}
Get formatted data from your object.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
format |
String
|
format module name |
|
options |
*
|
<repeatable> |
module options (see relevant documentation) |
Returns:
- Type:
-
String
|Arrat.<Object>
formatted data
get(optionsopt) → {String|Array.<Object>}
Get formatted data from your object.
- Deprecated:
- use Cite#format
- 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 |
reset(logopt) → {Cite}
Reset a Cite
object.
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
log |
Boolean
|
<optional> |
false |
Show this call in the log |
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.
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> |
{} | |
log |
Boolean
|
<optional> |
false |
Show this call in the log |
(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> |
{} | |
log |
Boolean
|
<optional> |
false |
Show this call in the log |
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 |
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. |
Type Definitions
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 Output 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