ORCID / bibtexParseJs

A JavaScript library that parses BibTeX parser.
MIT License
109 stars 39 forks source link

BibTeX isn't pretty #18

Closed nickbailey closed 6 years ago

nickbailey commented 7 years ago

I've imported bibtexParseJS into https://github.com/nickbailey/SMR-Web/tree/master/js as a submodule: it's a public website for an open academic journal (see picture).

I'm using the export to create user-copyable bibtex entries from BibTeX data. You say in the comments that you wrote the export in a hurry, but it appears to work just fine. I would suggest that the output be beautified more than it is. I suggest the rather trivial following diff.

patch.txt

I don't know if this is consistent with your philosophy, and I'm not competent in JavaScript, but I thought I should at least let you have the diff and the report that bibtexParseJs is working very well here.

Thanks!

smr_page-citation

rcpeters commented 6 years ago

Can we get a pull request?

nickbailey commented 6 years ago

On Tuesday, 31 October 2017 16:09:12 GMT Robert Peters wrote:

Can we get a pull request?

Sure thing.

I've made beautification optional. toBibtex now has an optional parameter, compact = true. So if you want multiline citations to be produced, pass false as a second parameter.

I think it works. Not production-live yet, but I've committed it to my local version.

Nick/.

rcpeters commented 6 years ago

Thanks!