Giter Site home page Giter Site logo

sam1360 / citationcore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mozillascience/citationcore

0.0 2.0 0.0 1.83 MB

Software Citation Tools

Home Page: https://github.com/mozillascience/software-citation-tools

License: MIT License

JavaScript 98.04% Shell 1.96%

citationcore's Introduction

citation-core

CitationCore is a framework designed to genreate a citation string given a URL to a code source like a GitHub or Bitbucket repository. It is part of a larger effort, lead by Mozilla Science Lab, to develop a suite of tools that aim to implement a standard for citing software and making it easier to cite software correctly. To learn more about this project you can visit the Software Citation Tools repository.

Install

CitationCore is distributed through npm. To install:

npm install citation-core

Contributor Install

If you are interested in contributing to citation-core please follow these install instructions. They will add a pre-commit hook that will run our linter and reject commits that do not meet the project's coding standards. We are adhereing to the AirBnb style guide.

git clone https://github.com/mozillascience/CitationCore.git
cd CitationCore
cp dev/pre-commit .git/hooks/

Usage

To generate a citation you must provide at least a url.

const CitationCore = require('citation-core');

let formatOptions = new CitationCore.FormatOptions();
formatOptions.url = 'http://github.com/apple/swift';

CitationCore.generate(formatOptions, (citationStr, errors) => {
	// Handle completion of citation generation
});

Citation Output:

Lattner, C., Gregor, D. & Gribenko, D. (2017). "swift". Version: Swift 3.0.1 Preview 3. Retrieved From: https://swift.org/ 

FormatOptions

The generate function requires an instance of the FormatOptions class. This class allows for customization of the output citation. The FormatOptions object has the following customizable properties:

URL

The url of the code source. Currently the framework supports GitHub.

formatOptions.url = 'http://github.com/scipy/scipy';

Style

The style template of the output citation. The framework currently supports the following formats:

  • apa
  • chicago
  • bibtexMisc
  • biblatexSoftware
formatOptions.style = CitationCore.styles.apa;

API Token

A token field for GitHub OAuth. Required for GitHub URL's.

Errors

The callback for the generate function second parameters is an array of errors. Not all errors are created equal. Some errors are critical and will halt generation, however some will be a warning. In this case the citation genreation will complete. If the citationStr parameter is null a critical error has occured.

API Documentation

API Documentation is viewable on github pages or locally in the docs directory.

citationcore's People

Contributors

nokeeo avatar ourobor avatar sam1360 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.