Skip to content

Citation.js plugin for the Hayagriva YAML format used in Typst

License

Notifications You must be signed in to change notification settings

citation-js/plugin-hayagriva

Repository files navigation

Citation.js plugin for the Hayagriva YAML format (v0.1.1) used in Typst.

NPM version Codecov NPM total downloads License

Install

npm install @citation-js/plugin-hayagriva

Use

Install the plugin by require-ing it:

require('@citation-js/plugin-hayagriva')

Formats

Formats and other features added by this plugin.

Input

Because Hayagriva has no distinguishing characteristics (compared to other bibliographical formats) that can be expected to occur in (nearly) all records, types have to be indicates manually:

const input = `citation-js:
    type: article
    title: "Citation.js: a format-independent, modular bibliography tool for the browser and command line"
    author: Willighagen, Lars G.
    date: 2019-08-12
    doi: 10.7717/peerj-cs.214
    serial-number: e214
    parent:
        type: periodical
        title:
            value: PeerJ Computer Science
            verbatim: true
        volume: 5
        issn: 2376-5992`

Cite(input, { forceType: '@hayagriva/file' })

{
  title: 'Citation.js: a format-independent, modular bibliography tool for the browser and command line',
  author: [{ family: 'Willighagen', given: 'Lars G.' }],
  issued: [{ 'date-parts': [[2019, 8, 12]] }],
  volume: 5,
  DOI: '10.7717/peerj-cs.214',
  number: 'e214',
  ISSN: '2376-5992',
  type: 'article-journal',
  'container-title': '<span class="nocase">PeerJ Computer Science</span>',
  'citation-key': 'citation-js'
}

Output

Cite(...).format('hayagriva', { asObject: false /* or true */ })

License

The code and most other contents in this repository is licensed MIT. test/input.yml contains examples from the Hayagriva repository, dual-licensed under MIT.

About

Citation.js plugin for the Hayagriva YAML format used in Typst

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published