https://github.com/cloudhead/hijs
simple & fast javascript syntax highlighting for the browser
https://github.com/cloudhead/hijs
Last synced: 7 months 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 15 years ago)
- Default Branch: master
- Last Pushed: 2015-07-16T01:49:33.000Z (over 10 years ago)
- Last Synced: 2024-12-09T18:11:40.929Z (over 1 year 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`:

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**