Namespace: config

@citation-js/plugin-csl.config

Members

(static) locales :module:@citation-js/core.util.Register

Different CSL Locales can be registered like this:

let language = 'en-GB'
let locale = '<?xml version="1.0" encoding="utf-8"?><locale ...>...</locale>' // The actual XML file

let config = plugins.config.get('csl')
config.locales.add(language, locale)

let example = new Cite(...)
example.format('bibliography', {
  format: 'html',
  template: 'apa',
  lang: language
})
Type:
Source:

(static) templates :module:@citation-js/core.util.Register

Different CSL Templates can be registered like this:

let templateName = 'custom'
let template = '<?xml version="1.0" encoding="utf-8"?><style ...>...</style>' // The actual XML file

let config = plugins.config.get('csl')
config.templates.add(templateName, template)

let example = new Cite(...)
example.format('bibliography', {
  format: 'html',
  template: templateName,
  lang: 'en-US'
})
Type:
Source:

Methods

(static) engine(data, style, locale, format)

The configuration object also exposes an internal method to prepare a Citeproc engine with given data and configuration:

let config = plugins.config.get('csl')

let citeproc = plugins.engine(
  [{ ... }], // data
  'apa',     // style
  'en-US',   // locale
  'html'     // format
)

let sortedIds = citeproc.updateItems(
  [...] // data ids
)
let makeBibliography = citeproc.makeBibliography()
Parameters:
Name Type Description
data module:@citation-js/core~CSL
style String
locale String
format String
Source: