mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 02:42:48 +00:00
36 lines
2.2 KiB
JSON
36 lines
2.2 KiB
JSON
{
|
|
"name": "highlight",
|
|
"description": "Highlight code syntax with node.js",
|
|
"version": "0.2.3",
|
|
"author": {
|
|
"name": "Andris Reinman"
|
|
},
|
|
"maintainers": [
|
|
{
|
|
"name": "andris",
|
|
"email": "andris@node.ee"
|
|
}
|
|
],
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "http://github.com/andris9/highlight.git"
|
|
},
|
|
"directories": {
|
|
"lib": "./lib"
|
|
},
|
|
"main": "./lib/highlight",
|
|
"licenses": [
|
|
{
|
|
"type": "BSD",
|
|
"url": "http://github.com/andris9/highlight/blob/master/LICENSE"
|
|
}
|
|
],
|
|
"readme": "highlight\n==============\n\n**highlight** for node.js is based on [highlight.js](http://softwaremaniacs.org/soft/highlight/en/) parser and is meant to highlight code syntax in languages that are not known beforehand (*highlight.js* detects the used language automatically). This is especially important for pages in Markdown format - there's no easy way to know which language is actually used.\n\nInstallation\n------------\n\nUse `npm` package manager\n\n npm install highlight\n\nUsage\n-----\n\nInclude syntax highlighter\n\n var hl = require(\"highlight\").Highlight;\n \nhighlight code\n\n html = hl(\"for(var i=0;i<10;i++)alert(i);\");\n\nuse special tab replacing string (default is 4 spaces)\n\n html = hl(code_string, \"<span> </span>\");\n\nconvert code only between <code> blocks (leaves everything else as is) - especially useful if used together with converted [Markdown](/andris9/node-markdown) syntax that includes <code> blocks.\n\n html = hl(\"<p>PHP:</p><code><?php echo 'Hello world!';?></code>\", false, true);\n\nStyles\n------\n\n**highlight** outputs HTML code with predefined CSS class names for different elements. This doesn't make a lot of sense by default (it's just a bunch of SPAN's) so you need to use a CSS file that sets the used color set for the highlighting. There's some sample CSS files in /lib/vendor/highlight.js/styles that can be used with no modification - just include one of the files in the page you are showing the highlighted code.\n\n <link rel=\"stylesheet\" href=\"/path/to/styles/default.css\"/>",
|
|
"readmeFilename": "README.md",
|
|
"bugs": {
|
|
"url": "https://github.com/andris9/highlight/issues"
|
|
},
|
|
"_id": "highlight@0.2.3",
|
|
"_from": "highlight@0.2.3"
|
|
}
|