Basics

Block of code


        public class HelloWorld {
            public static void main(String[] args) {
                System.out.println("Hello, Java!"); // a comment
            }
        }
      

Inline code

This is Some("inline") code.

File fetched with AJAX(this one)

File from Github API (this one)

File from a Gist (this one)


Line numbers

Default


        public class HelloWorld {
            public static void main(String[] args) {
                System.out.println("Hello, Java!"); // a comment
            }
        }
      

Shifted line numbers (start from -2)


        def hello(name)
          puts "Hello #{name}"
        end
        hello("Ruby")
      

No line numbers


          object HelloWorld {
            def main(args: Array[String]): Unit = {
              println("Hello, world!")
            }
          }
        

Highlight lines

Highlight some lines ("1,5-6"), perfect for tutorials


          #include <iostream>

          int main()
          {
            std::cout << "Hello World!" << std::endl;
            return 0;
          }
        

Command line

Default


        NAME="John"
        echo "Hello $NAME!"
      

Custom user


          echo "Test, test..."
          echo "Test, test..."
          echo "Test, test..."
        

Custom prompt

set foo=bar;

Output lines ("2-5")


          batchtest.bat
          foo
          bar
          bat
          batch
        

HTML & CSS

Unescaped HTML

CSS (also with Data-URI Highlight)


          div {
              border: 40px solid transparent;

              border-image: 33.334% url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30"> \
                          <circle cx="5" cy="5" r="5" fill="%23ab4"/><circle cx="15" cy="5" r="5" fill="%23655"/> \
                          <circle cx="25" cy="5" r="5" fill="%23e07"/><circle cx="5" cy="15" r="5" fill="%23655"/> \
                          <circle cx="15" cy="15" r="5" fill="hsl(15, 25%, 75%)"/> \
                          <circle cx="25" cy="15" r="5" fill="%23655"/><circle cx="5" cy="25" r="5" fill="%23fb3"/> \
                          <circle cx="15" cy="25" r="5" fill="%23655"/><circle cx="25" cy="25" r="5" fill="%2358a"/></svg>');

              font: 130%/1.6 Baskerville, Palatino, serif;
          }