MIT License

项目介绍

larsgw/citation.js 是一个托管在 GitHub 上的开源项目,主要使用 JavaScript 编写,采用 MIT License 许可证,目前获得 241 个 Star、28 次 Fork。

仓库全名
larsgw/citation.js
开源许可证
MIT License
Star 数
241
Fork 数
28
未关闭 Issue
13

README 摘要

Please use citation-js/citation-js if possible. citation-js/citation-js | replaces | larsgw/citation.js | This repository contains the npm package @citation-js/core and several other components. || This repository contains the npm package citation-js that wraps the aforementioned components for backwards compatibility. | Install Getting Started CLI Cite Async Acknowledgements Install On Node.js, install the package…

完整内容见 GitHub 原始 README 或本页 。

常见问题

citation.js 用什么语言开发?

主要使用 JavaScript 编写,采用 MIT License 许可证,目前有 241 个 Star。

citation.js 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 citation.js 的源码?

可以直接克隆仓库:git clone https://github.com/larsgw/citation.js.git,默认分支为 main;安装与运行步骤见仓库 README。

citation.js 最近还在维护吗?

仓库最近一次更新为 9月18日,当前有 13 个未关闭 Issue;Star 数为 241,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

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.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
302
价值分
152
活跃状态
活跃

语言占比

JavaScript
Roff
Shell

Release

README

NPM version NPM total downloads Build Status JavaScript Style Guide

Please use citation-js/citation-js if possible.

citation-js/citation-js replaces larsgw/citation.js
This repository contains the npm package @citation-js/core and several other components. This repository contains the npm package citation-js that wraps the aforementioned components for backwards compatibility.

Install

On Node.js, install the package (citation-js) like this:

npm install citation-js

To install the CLI as a global command, do this:

npm install --global citation-js

Browser releases are available here. These define require and add citation-js as a module.

<script src="path/to/citation.js" type="text/javascript"></script>
<script>
  const Cite = require('citation-js')
</script>

Getting Started

You can read a guide on how to get started, together with some tutorials and examples, here.

CLI

More info

Run the CLI like this:

citation-js  [options]

Options:

  -h, --help                      output usage information
  -V, --version                   output the version number

  -i, --input <path>              Input file
  -u, --url <url>                 Input url
  -t, --text <string>             Input text

  -o, --output <path>             Output file (omit file extension)

  -R, --output-non-real           Do not output the file in its mime type, but as a string
  -f, --output-type <option>      Output structure type: string, html, json
  -s, --output-style <option>     Output scheme. A combination of --output-format json and --output-style citation-* is considered invalid. Options: csl (Citation Style Lanugage JSON), bibtex, citation-* (where * is any formatting style)
  -l, --output-language <option>  Output language. [RFC 5646](https://tools.ietf.org/html/rfc5646) codes

Cite

More info

To use the Cite constructor, require() the module like this:

const Cite = require('citation-js')

For example, to get the bibliographical data of the Wikidata item wd:Q21972834, and then format it in HTML, English and APA:

let example = new Cite('Q21972834')

let output = example.format('bibliography', {
  format: 'html',
  template: 'apa',
  lang: 'en-US'
})

console.log(output)

To test this code, go to RunKit.

Async

Use the async API (recommended for Wikidata, URL, and DOI input) like this:

let example = await Cite.async('Q21972834')

let output = example.format('bibliography', {
  format: 'html',
  template: 'apa',
  lang: 'en-US'
})

console.log(output)

Cite.async() also supports options as the second argument, and a callback function as last argument.

评论

暂无评论