Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 55 lines (33 sloc) 1.21 kb
970afa2 (doc) markdownified README
cloudhead authored
1 hijs
2 ====
3
4 > hijs is a dead-simple syntax highlighter for JavaScript code on the browser.
5
6 By default, it highlights everything inside `<code>` blocks.
7
8 If you have command-line snippets, such as:
9
10 $ ls -l > /dev/null
11
12 it will skip those, cause they ain't no JavaScript.
13
667e456 (doc) README update
cloudhead authored
14 usage
15 -----
16
cebd9be (doc) README update
Alexis Sellier authored
17 Put this at the end of your `<body>`:
18
667e456 (doc) README update
cloudhead authored
19 <script src="hijs.js"></script>
20
cebd9be (doc) README update
Alexis Sellier authored
21 If you would like to specify what gets highlighted, set the global `hijs` variable before you include the script:
22
23 window.hijs = '.highlight';
24
970afa2 (doc) markdownified README
cloudhead authored
25 example
26 -------
27
8408dfb (doc) README clarification
cloudhead authored
28 Code extract from http-console, highlighted by `hijs`:
667e456 (doc) README update
cloudhead authored
29
794bdf2 (doc) clearer screenshot
cloudhead authored
30 ![screenshot](http://dl.dropbox.com/u/251849/hijs-example.png)
970afa2 (doc) markdownified README
cloudhead authored
31
32 philosophy
33 ----------
34
35 hijs is a simple solution to a potentially complicated problem. It won't
36 fit all your needs, but if what you're trying to achieve is simple enough,
37 hijs might be the tool for you.
38
39 styling
40 -------
41
42 hijs wraps tokens in `<span>` tags. You can style them like so:
43
44 code .keyword { font-weight: bold }
45 code .string, code .regexp { color: green }
46 code .class, code .special { color: blue }
47 code .number { color: pink }
48 code .comment { color: grey }
49
50 more info
51 ---------
52
53 **RTFC**
54
Something went wrong with that request. Please try again.