Syntax highlighter
npm install highlights
Reads in code, writes out HTML with CSS classes based on the tokens in the code.

See it in action here.
``sh`
npm install highlights
Run highlights -h for full details about the supported options.
To convert a source file to tokenized HTML run the following:
`sh`
highlights file.coffee -o file.html
Now you have a file.html file that has a big
tag with afor
each line withelements for each token.`Then you can compile an existing Atom theme into a stylesheet with the
following:sh`
git clone https://github.com/atom/atom-dark-syntax
cd atom-dark-syntax
npm install -g less
lessc --include-path=styles index.less atom-dark-syntax.cssatom-dark-syntax.cssNow you have an
stylesheet that be combined withfile.html
thefile to generate some nice looking code.`Check out the examples to see
it in action.Check out atom.io to find more themes.
Some popular themes:
* atom-dark-syntax
* atom-light-syntax
* solarized-dark-syntax
* solarized-light-syntax#### Using in code
coffee`
Highlights = require 'highlights'
highlighter = new Highlights()
html = highlighter.highlightSync
fileContents: 'var hello = "world";'
scopeName: 'source.js'console.log html
`Outputs:
html`
var
hello
=
"
world
"
;
requireGrammarsSync$3
highlights exposes the method
, for loading grammars from`
npm modules. The usage is as follows:bash`
npm install atom-language-clojure`coffee`
Highlights = require 'highlights'
highlighter = new Highlights()
highlighter.requireGrammarsSync
modulePath: require.resolve('atom-language-clojure/package.json')git clone https://github.com/atom/highlights$3
* Clone this repository
git submodule update --init --recursive
* Update the submodules by runningnpm install
* Runto install the dependencies, compile the CoffeeScript, andnpm test` to run the specs
build the grammars
* Run:green_heart: Pull requests are greatly appreciated and welcomed.