Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cloudhead/hijs
simple & fast javascript syntax highlighting for the browser
https://github.com/cloudhead/hijs
Last synced: about 1 month ago
JSON representation
simple & fast javascript syntax highlighting for the browser
- Host: GitHub
- URL: https://github.com/cloudhead/hijs
- Owner: cloudhead
- License: mit
- Created: 2010-06-12T19:15:30.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2015-07-16T01:49:33.000Z (about 9 years ago)
- Last Synced: 2024-06-03T07:35:07.201Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 118 KB
- Stars: 240
- Watchers: 6
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
hijs
====> hijs is a dead-simple syntax highlighter for JavaScript code on the browser.
By default, it highlights everything inside `
` blocks.
If you have command-line snippets, such as:
$ ls -l > /dev/null
it will skip those, cause they ain't no JavaScript.
usage
-----Put this at the end of your ``:
If you would like to specify what gets highlighted, set the global `hijs` variable before you include the script:
window.hijs = '.highlight';
example
-------Code extract from http-console, highlighted by `hijs`:
![screenshot](http://dl.dropbox.com/u/251849/hijs-example.png)
philosophy
----------hijs is a simple solution to a potentially complicated problem. It won't
fit all your needs, but if what you're trying to achieve is simple enough,
hijs might be the tool for you.styling
-------hijs wraps tokens in `` tags. You can style them like so:
code .keyword { font-weight: bold }
code .string, code .regexp { color: green }
code .class, code .special { color: blue }
code .number { color: pink }
code .comment { color: grey }more info
---------**RTFC**