bibtex

阅读时长 5 分钟读完

Library for parsing a BiBTeX file in pure Javascript / Typescript

bibtex-js

Live demo in browser

Library for parsing BibTeX .bib files, based mostly on the excellent guide to BibTeX, Tame the BeaST.

Written in Typescript, compiled to ES5 Javascript (with typings provided).

This module literally just parses a BibTex file and processes it as far as BibTeX goes. It doesn't process TeX commands (i.e., {\"o} is not translated to ö). If you want to actually work with a bibliography, look for Bibliography.js.

Implementation

Not all internal BibTeX functions are implemented, simply because I don't need them personally. Most notably sorting entries is still an open issue because BibTeX has a little complicated algorithm which required a function that "purifies" field values, which for example makes {\ss} equivalent to ss but makes ä come after z. I am unsure if that is actually what anyone wants in modern days though. A modern approach would be to use Unicode collation and then sort.

Pull requests and issues are welcome.

Usage

-- -------------------- ---- -------
------ -------------- ---- ---------

----- ------- - --------------

-----------------------
  ------    - -------- ------------- --- -------- ----- --- ------- -----
  -----     - ------------- ---------- -------- --- -------------- -------- --- -------- ------------
  --------- - ------------ -- ------------- ----------- ------- --- ------- -------- ------------
  -----     - -------
  ----      - -------
  -------   - ---------- --------
  --------- - ------------ --- ------------- -------------
  ---       - -------------------------------------------
  ----- - --------
-
---

------------
    -- ---- --- ----------------
    ---------------------------------------------
-- -- ------ ---- ----------- ------

License

MIT

HomePage

https://github.com/digitalheir/bibtex-js#readme

Repository

git+ssh://git@github.com/digitalheir/bibtex-js.git

来源:JavaScript中文网 ,转载请注明来源 https://www.javascriptcn.com/post/6005607881e8991b448dea5f

纠错
反馈