GithubHelp home page GithubHelp logo

yepengding / bibtex-js-parser Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 766 KB

A BitTeX parser implemented in JavaScript (ES6). Transforming a BibTeX file to an object in memory or a semi-structured file on disk.

License: MIT License

JavaScript 100.00%
bibtex browser grammar parser

bibtex-js-parser's People

Contributors

yepengding avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

bibtex-js-parser's Issues

Make the type case insensitive

Currently, type is sensitive, which is not convenient.

For example, the following example does not work:

@InProceedings{Foo,
  author    = {Tom and the gang},
  booktitle = {Something amazing},
  title     = {An awesome research},
  year      = {2022},
  month     = {jun},
}

But with type all lowercase, it works:

@inproceedings{Foo,
  author    = {Tom and the gang},
  booktitle = {Something amazing},
  title     = {An awesome research},
  year      = {2022},
  month     = {jun},
}

BibTeX Entries without Trailing Commas

The BibTeX standard does not explicitly require the last entry to end with a comma. Moreover, example from Wikipedia and automatically generated BibTeX from Google Scholar do not include a comma at the end of the last entry.

While bibtex-js-parser currently handles entries without trailing commas correctly and produces the expected output, it also prints a warning in the console for such cases.

Take the example in the README, if we remove the comma at the end of the last entry, it would be:

@inproceedings{ding_dagbase_2020,
	title = {Dagbase: a decentralized database platform {Using} {DAG}-based consensus},
	copyright = {All rights reserved},
	isbn = {1-72817-303-5},
	booktitle = {2020 {IEEE} 44th {Annual} {Computers}, {Software}, and {Applications} {Conference} ({COMPSAC})},
	publisher = {IEEE},
	author = {Ding, Yepeng and Sato, Hiroyuki},
	year = {2020},
	pages = {798--807}
}

@article{ding_formalism-driven_2022,
	title = {Formalism-{Driven} {Development}: {Concepts}, {Taxonomy}, and {Practice}},
	volume = {12},
	copyright = {All rights reserved},
	issn = {2076-3417},
	url = {https://www.mdpi.com/2076-3417/12/7/3415},
	doi = {10.3390/app12073415},
	number = {7},
	journal = {Applied Sciences},
	author = {Ding, Yepeng and Sato, Hiroyuki},
	year = {2022}
}

This would cause two warnings:

line 10:0 missing ',' at '}'
line 23:0 missing ',' at '}'

I suggest changing the program's behavior to make it more tolerant of entries without trailing commas, eliminating the warning from the console output. This adjustment would align the program with common BibTeX practices and user expectations.

In addition, the warning printed to the console does not indicate that it is from bibtex-js-parser. It would be more helpful for users to debug if the warning message can indicate its source (for example, print bibtex-js-parser: line 10:0 missing ',' at '}'). I spent a lot of time looking for where the warning comes from.

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.