# Highlight.js
[](https://travis-ci.org/highlightjs/highlight.js) [](https://greenkeeper.io/) [](https://packagephobia.now.sh/result?p=highlight.js)
Highlight.js is a syntax highlighter written in JavaScript. It works in
the browser as well as on the server. It works with pretty much any
markup, doesn’t depend on any framework, and has automatic language
detection.
## Getting Started
The bare minimum for using highlight.js on a web page is linking to the
library along with one of the styles and calling
[`initHighlightingOnLoad`][1]:
```html
<link rel="stylesheet" href="/path/to/styles/default.css">
<script src="/path/to/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
```
This will find and highlight code inside of `<pre><code>` tags; it tries
to detect the language automatically. If automatic detection doesn’t
work for you, you can specify the language in the `class` attribute:
```html
<pre><code class="html">...</code></pre>
```
Classes may also be prefixed with either `language-` or `lang-`.
```html
<pre><code class="language-html">...</code></pre>
```
### Plaintext and Disabling Highlighting
To style arbitrary text like code, but without any highlighting, use the
`plaintext` class:
```html
<pre><code class="plaintext">...</code></pre>
```
To disable highlighting of a tag completely, use the `nohighlight` class:
```html
<pre><code class="nohighlight">...</code></pre>
```
### Supported Languages
The table below shows the full list of supported languages (and corresponding classes) that are bundled with the library. Note: Which languages are available may depend on how you've built or included the library in your app. See [Getting the Library](#getting-the-library) below.
<details>
<summary>Reveal the full list of languages...</summary>
| Language | Classes | Package |
| :-----------------------| :--------------------- | :------ |
| 1C | 1c | |
| ABNF | abnf | |
| Access logs | accesslog | |
| Ada | ada | |
| ARM assembler | armasm, arm | |
| AVR assembler | avrasm | |
| ActionScript | actionscript, as | |
| Alan | alan, i | [highlightjs-alan](https://github.com/highlightjs/highlightjs-alan) |
| AngelScript | angelscript, asc | |
| Apache | apache, apacheconf | |
| AppleScript | applescript, osascript | |
| Arcade | arcade | |
| AsciiDoc | asciidoc, adoc | |
| AspectJ | aspectj | |
| AutoHotkey | autohotkey | |
| AutoIt | autoit | |
| Awk | awk, mawk, nawk, gawk | |
| Axapta | axapta | |
| Bash | bash, sh, zsh | |
| Basic | basic | |
| BNF | bnf | |
| Brainfuck | brainfuck, bf | |
| C# | cs, csharp | |
| C++ | cpp, c, cc, h, c++, h++, hpp | |
| C/AL | cal | |
| Cache Object Script | cos, cls | |
| CMake | cmake, cmake.in | |
| Coq | coq | |
| CSP | csp | |
| CSS | css | |
| Cap’n Proto | capnproto, capnp | |
| Clojure | clojure, clj | |
| CoffeeScript | coffeescript, coffee, cson, iced | |
| Crmsh | crmsh, crm, pcmk | |
| Crystal | crystal, cr | |
| Cypher (Neo4j) | cypher | [highlightjs-cypher](https://github.com/highlightjs/highlightjs-cypher) |
| D | d | |
| DNS Zone file | dns, zone, bind | |
| DOS | dos, bat, cmd | |
| Dart | dart | |
| Delphi | delphi, dpr, dfm, pas, pascal, freepascal, lazarus, lpr, lfm | |
| Diff | diff, patch | |
| Django | django, jinja | |
| Dockerfile | dockerfile, docker | |
| dsconfig | dsconfig | |
| DTS (Device Tree) | dts | |
| Dust | dust, dst | |
| Dylan | dylan | [highlight-dylan](https://github.com/highlightjs/highlight-dylan) |
| EBNF | ebnf | |
| Elixir | elixir | |
| Elm | elm | |
| Erlang | erlang, erl | |
| Excel | excel, xls, xlsx | |
| Extempore | extempore, xtlang, xtm | [highlightjs-xtlang](https://github.com/highlightjs/highlightjs-xtlang) |
| F# | fsharp, fs | |
| FIX | fix | |
| Fortran | fortran, f90, f95 | |
| G-Code | gcode, nc | |
| Gams | gams, gms | |
| GAUSS | gauss, gss | |
| GDScript | godot, gdscript | [highlightjs-gdscript](https://github.com/highlightjs/highlightjs-gdscript) |
| Gherkin | gherkin | |
| GN for Ninja | gn, gni | [highlightjs-GN](https://github.com/highlightjs/highlightjs-GN/blob/master/gn.js) |
| Go | go, golang | |
| Grammatical Framework | gf | [highlightjs-gf](https://github.com/johnjcamilleri/highlightjs-gf) |
| Golo | golo, gololang | |
| Gradle | gradle | |
| Groovy | groovy | |
| HTML, XML | xml, html, xhtml, rss, atom, xjb, xsd, xsl, plist, svg | |
| HTTP | http, https | |
| Haml | haml | |
| Handlebars | handlebars, hbs, html.hbs, html.handlebars | |
| Haskell | haskell, hs | |
| Haxe | haxe, hx | |
| Hy | hy, hylang | |
| Ini, TOML | ini, toml | |
| Inform7 | inform7, i7 | |
| IRPF90 | irpf90 | |
| JSON | json | |
| Java | java, jsp | |
| JavaScript | javascript, js, jsx | |
| Kotlin | kotlin, kt | |
| Leaf | leaf | |
| Lasso | lasso, ls, lassoscript | |
| Less