Skip to content

jgallen23/highlight.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Highlight.js

Highlight.js is a node.js fork of highlight.js for the browser.

##Install

npm install highlight.js

##Usage

###Auto Language Detection:

var hl = require("highlight.js");
var txt = "var test = 'asdf'";
var html = hl.highlightAuto(txt);
console.log(html.value);

###Pass in Language:

var hl = require("highlight.js");
var txt = "var test = 'asdf'";
var html = hl.highlight('javascript', txt);
console.log(html.value);

##Example Output:

<span class="keyword">var</span> test = <span class="string">'asdf'</span>

About

Node.js syntax highlighter

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%