0.3.3 • Published 3 years ago

jshighlight v0.3.3

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

jsHighlight - Simple syntax highlighting for webapps

Build CodeQL codecov Dependency Status Dev Dependency Status

I built this after highlight.js being too heavy, and requiring a custom build to remove unneeded parsers, and other highlighting packages having similar issues.

Install

git clone git@github.com/github.com/bobbylight/jshighlight.git
cd jshighlight
npm install
npm run build   # Compiles source and builds the library into lib/
npm run watch   # Compiles demo app into demo/ and watches for changes

The demo application will be hosted at file://path/to/jshilight/demo/index.html.

To run tests:

npm test         # Tests only
npm run coverage # Generates coverage report

The generated coverage report lives here:

open coverage/index.html

Consuming the library in a TypeScript application

import highlighter from 'jshighlight/lib/highlighter';
import JsonParser from 'jshighlight/lib/parsers/json-parser';

...

const html: string = highlighter.highlight(new JsonParser(), jsonStr);
0.3.3

3 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago