How to use the @citation-js/plugin-csl/lib/engines.fetchEngine function in @citation-js/plugin-csl

To help you get started, we’ve selected a few @citation-js/plugin-csl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github larsgw / citation.js / index.js View on Github external
Cite.validateOptions = core.Cite.validateOptions
Cite.validateOutputOptions = core.Cite.validateOutputOptions

Cite.input = core.plugins.input.chain
Cite.inputAsync = core.plugins.input.chainAsync

Cite.util = Object.assign({ attr }, core.util)
Cite.version = {
  cite: core.version,
  citeproc: citeproc.PROCESSOR_VERSION
}

const CSL = core.plugins.config.get('@csl')

Cite.CSL = {
  engine: require('@citation-js/plugin-csl/lib/engines').fetchEngine,
  item (data) {
    return id => data.find(entry => entry.id === id)
  },
  locale (lang) {
    return CSL.styles.get(CSL.styles.has(lang) ? lang : 'en-US')
  },
  style (style) {
    return CSL.templates.get(CSL.templates.has(style) ? style : 'apa')
  },
  register: {
    addTemplate: CSL.templates.add.bind(CSL.templates),
    getTemplate: CSL.templates.get.bind(CSL.templates),
    hasTemplate: CSL.templates.has.bind(CSL.templates),
    addLocale: CSL.locales.add.bind(CSL.locales),
    getLocale: CSL.locales.get.bind(CSL.locales),
    hasLocale: CSL.locales.has.bind(CSL.locales)

@citation-js/plugin-csl

Plugin for CSL output for Citation.js

MIT
Latest version published 5 months ago

Package Health Score

73 / 100
Full package analysis

Popular @citation-js/plugin-csl functions