Highlight.js

Highligth.js is a tool used in this website to colorize and format the code. It is a free tool written in Javascript and fully customizable. The languages for which there is coloing support include: C++, Python, HTML... Here you can find some example.

C++:


#include <header.h>

class my_class {
  my_class();
  
  void my_function(int);
  
  private:
    int member;
}

Python:


import module as mod

class my_class():
  def __init__(self):
    pass
  
  def my_function():
    print("My Function")
TeX:

  \frac{1}{2} \cdot x \int_1^b f(x) dx
HTML, XML, ...:

<mrow>
  <mi>A</mi>
  <mo>=</mo>
  <mfenced open="[" close="]">
    <mtable>
      <mtr>
         <mtd><mi>x</mi></mtd>
         <mtd><mi>y</mi></mtd>
      </mtr>
      <mtr>
         <mtd><mi>z</mi></mtd>
         <mtd><mi>w</mi></mtd>
      </mtr>
    </mtable>
  </mfenced>
</mrow>