GitHub markdown code highlight identifier 2016-07-11 04:30
You can use code block in markdown to make code read easily. GitHub support different language identifier to highlight the keywords. The list of identifiers are here. Click highlight.js demo page for detail.
Language | highlight code | Language | highlight code |
---|---|---|---|
1C | 1c | LiveCode | livecodeserver |
Access log | accesslog | LiveScript | livescript |
ActionScript | actionscript | Linden Scripting Language | lsl |
Ada | ada | Lua | lua |
Apache | apache | Makefile | makefile |
AppleScript | applescript | Markdown | markdown |
Arduino | arduino | Mathematica | mathematica |
ARM Assembly | armasm | Matlab | matlab |
AsciiDoc | asciidoc | Maxima | maxima |
AspectJ | aspectj | MEL | mel |
AutoHotkey | autohotkey | Mercury | mercury |
AutoIt | autoit | MIPS Assembly | mipsasm |
AVR Assembler | avrasm | Mizar | mizar |
Axapta | axapta | Mojolicious | mojolicious |
Bash | bash | Monkey | monkey |
Basic | basic | MoonScript | moonscript |
Backus–Naur Form | bnf | Nginx | nginx |
Brainfuck | brainfuck | Nimrod | nimrod |
C/AL | cal | Nix | nix |
Cap’n Proto | capnproto | NSIS | nsis |
Ceylon | ceylon | Objective-C | objectivec |
Clojure REPL | clojure-repl | OCaml | ocaml |
Clojure | clojure | OpenSCAD | openscad |
CMake | cmake | Oxygene | oxygene |
CoffeeScript | coffeescript | Parser3 | parser3 |
Coq | coq | Perl | perl |
Caché Object Script | cos | pf | pf |
C++ | cpp | PHP | php |
crmsh | crmsh | Pony | pony |
Crystal | crystal | PowerShell | powershell |
C# | cs | Processing | processing |
CSP | csp | Python profile | profile |
CSS | css | Prolog | prolog |
D | d | Protocol Buffers | protobuf |
Dart | dart | Puppet | puppet |
Delphi | delphi | PureBASIC | purebasic |
Diff | diff | Python | python |
Django | django | Q | q |
DNS Zone file | dns | QML | qml |
Dockerfile | dockerfile | R | r |
DOS .bat | dos | RenderMan RIB | rib |
dsconfig | dsconfig | Roboconf | roboconf |
Device Tree | dts | RenderMan RSL | rsl |
Dust | dust | Ruby | ruby |
Elixir | elixir | Oracle Rules Language | ruleslanguage |
Elm | elm | Rust | rust |
ERB (Embedded Ruby) | erb | Scala | scala |
Erlang REPL | erlang-repl | Scheme | scheme |
Erlang | erlang | Scilab | scilab |
Excel | excel | SCSS | scss |
FIX | fix | Smali | smali |
Fortran | fortran | Smalltalk | smalltalk |
F# | fsharp | SML | sml |
GAMS | gams | SQF | sqf |
GAUSS | gauss | SQL | sql |
G-code (ISO 6983) | gcode | Stan | stan |
Gherkin | gherkin | Stata | stata |
GLSL | glsl | STEP Part 21 | step21 |
Go | go | Stylus | stylus |
Golo | golo | Swift | swift |
Gradle | gradle | Tagger Script | taggerscript |
Groovy | groovy | Test Anything Protocol | tap |
Haml | haml | Tcl | tcl |
Handlebars | handlebars | TeX | tex |
Haskell | haskell | Thrift | thrift |
Haxe | haxe | TP | tp |
HSP | hsp | Twig | twig |
HTMLBars | htmlbars | TypeScript | typescript |
HTTP | http | Vala | vala |
Inform 7 | inform7 | VB.NET | vbnet |
Ini | ini | VBScript in HTML | vbscript-html |
IRPF90 | irpf90 | VBScript | vbscript |
Java | java | Verilog | verilog |
JavaScript | javascript | VHDL | vhdl |
JSON | json | Vim Script | vim |
Julia | julia | Intel x86 Assembly | x86asm |
Kotlin | kotlin | XL | xl |
Lasso | lasso | HTML, XML | xml |
LDIF | ldif | XQuery | xquery |
Less | less | YAML | yaml |
Lisp | lisp | Zephir | zephir |
example
Add java code in your markdown
```java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("hello world!");
}
}
```