Skip to content

Commit

Permalink
Math support and more examples
Browse files Browse the repository at this point in the history
+ Added support for `$...$` math within text such as abstract
+ Added two large real-life bibliographies
  • Loading branch information
SaswatPadhi committed Mar 17, 2019
1 parent 1457fb6 commit 218606a
Show file tree
Hide file tree
Showing 10 changed files with 15,363 additions and 51 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.0.0] - 2019-03-17
### Added
- Added initial regexes for parsing BibTeX files in PrismJS framework.
- Published package to npm.



[Unreleased]: https://github.com/SaswatPadhi/prismjs-bibtex/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/SaswatPadhi/prismjs-bibtex/releases/tag/v1.0.0
30 changes: 23 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
[PrismJS] is great! The minified core is less than 6 KB, the API is gorgeous,
and although it uses simple regex matching, it is surprisingly accurate in most cases.
However, although it officially supports 175 languages currently, there is no support for [BibTeX] 😒
However, although it officially supports 175 languages currently, there is no support for [BibTeX] 😒 ...

So here is a BibTeX language extension for PrismJS! 😁
It took me less than an hour to code it up, thanks to the fantastic extension support in PrismJS.
Our minified JS file is about 1.5 KB and all you need to do to highlight those BibTeX snippets,
is just load our JS file after `prism.js`.
<br>
Thanks to the fantastic extension support in PrismJS,
it took me less than an hour and only about 60 lines to write the initial version.
The minified JS file is less than 1.5&thinsp;KB and all you need to do to highlight those BibTeX snippets,
is just load it after `prism.js`.



<p align="center">
<img src="screenshot.png" width="531"/>
<br>
See <a href='https://saswatpadhi.github.io/prismjs-bibtex/'>this page</a> for many more live examples.
<img src="screenshot.png" width="531"/>
</p>



## &raquo; Examples

- Check out some basic BibTeX examples [on our webpage](https://saswatpadhi.github.io/prismjs-bibtex/)
- Or, the significantly larger (144&thinsp;KB) [ACM Turing Awards bibliography](https://saswatpadhi.github.io/prismjs-bibtex/acm-turing-awards.html)
- Or, the even bigger (534&thinsp;KB) [STOC 2010 -- 2019 bibliography](https://saswatpadhi.github.io/prismjs-bibtex/stoc_2010-2019.html) that contains abstracts of the papers (with `$...$` math)



## &raquo; Basic Usage

Using this extension is super simple --- just import `prism-bibtex.min.js` in the `head` of your HTML page.
Expand All @@ -30,5 +40,11 @@ The `defer` attribute delays the script execution (but not download) until the H



## &raquo; Usage with Node

Install the package using `npm install prismjs-biblatex`.



[BibTeX]: http://www.bibtex.org/
[prismjs]: https://prismjs.com/
3,294 changes: 3,294 additions & 0 deletions docs/acm-turing-awards.md

Large diffs are not rendered by default.

Loading

0 comments on commit 218606a

Please sign in to comment.