How to use the citation-js.CSL function in citation-js

To help you get started, we’ve selected a few citation-js 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 seulibrary / Sorin / apps / frontend / assets / js / components / Citation / index.js View on Github external
buildCHI = () => {
        let cData = this.props.data

        Cite.CSL.register.addTemplate("chicago", chicago)

        if (!Array.isArray(cData)) {
            cData = [cData]
        }

        let citationCHI = cData.map(data => {
            let json = this.parseCitation(data)
            let cite = new Cite(json)

            return cite.format("bibliography", {
                format: "html",
                template: "chicago"
            })
        })

        return citationCHI.join("")
github seulibrary / Sorin / apps / frontend / assets / js / components / Citation / index.js View on Github external
buildMLA = () => {
        let cData = this.props.data

        Cite.CSL.register.addTemplate("mla", mla)

        if (!Array.isArray(cData)) {
            cData = [cData]
        }

        let citationMLA = cData.map(data => {
            let json = this.parseCitation(data)
            let cite = new Cite(json)

            return cite.format("bibliography", {
                format: "html",
                template: "mla"
            })
        })

        return citationMLA.join("")

citation-js

Citation.js converts formats like BibTeX, Wikidata JSON and ContentMine JSON to CSL-JSON to convert to other formats like APA, Vancouver and back to BibTeX.

MIT
Latest version published 8 days ago

Package Health Score

68 / 100
Full package analysis