GithubHelp home page GithubHelp logo

tony / astrocite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dsifford/astrocite

0.0 0.0 0.0 2.06 MB

Bibliography file format => AST => CSL JSON

License: MIT License

TypeScript 80.51% TeX 19.49%

astrocite's Introduction

Join the chat at https://gitter.im/astrocite/Lobby Build Status codecov

astrocite

Bibliography Format => AST => CSL JSON

Mission: The goal of this project is to create a single location where high-quality, safe, and efficient X => CSL JSON parsers can be found.

What this project solves: Currently there exists a wide range of CSL JSON parsers for a variety of reference types. However, most of these parsers rely on unsafe or inefficent methods of parsing input files (generally using complex regular expressions with lookbehinds, or inefficiently looping over the same input text several times). This project abandons that strategy by first parsing input files into Abstract Syntax Trees and then parsing CSL JSON from the tree structure. The result of this is a safer, faster, and more predictable experience for developers.

NOTE: This project is currently a work in progress. The API is subject to change drastically and without warning. Any use of this library is at your own risk until either this message disappears or version ^1.x.x is released.

Table of Contents

Install

$ npm install astrocite

Usage

Modular (smaller bundles)

import { parse } from 'astrocite-bibtex';
// or
const parse = require('astrocite-bibtex').parse;

const cslJson = parse(`
@article{my_article,
    title = {Hello world},
    journal = "Some Journal"
}
`);

Classic

import * as astrocite from 'astrocite';
// or
const astrocite = require('astrocite');

const cslJson = astrocite.bibtex.parse(`
@article{my_article,
    title = {Hello world},
    journal = "Some Journal"
}
`);

ASTs are also available if needed.

import { AST } from 'astrocite-bibtex';
// or
// import { AST } from 'astrocite-ris';
// ....etc

const bibtexAST = AST.parse(`
@article{my_article,
    title = {Hello world},
    journal = "Some Journal"
}
`);

Note: Examples for each individual AST can be found in the README file of each subdirectory.

Contributing

PRs accepted. Please see our Roadmap and Contributing Guidelines for more details.

License

MIT © 2017 Derek P Sifford

astrocite's People

Contributors

dependabot[bot] avatar dsifford avatar efficacy avatar hubgit avatar retorquere 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.