Code Example

1 minute read Published: 2017-09-24

Have code snippets complete with clipboard functionality and fancy language tags. No more boring code snippets in your pages. Oh yeah baby! Click on this article to see some code in action.


fn main() {
    println!("Hello World");
}

Same snippet with line numbers:

1fn main() {
2 println!("Hello World");
3}

Same snippet with line numbers and line highlighting:

1fn main() {
2 println!("Hello World");
3}

Python example:


def main():
    print("Hello, world!")

This is another code block with syntax highlighting. It's pretty cool, right? You can also have inline code like this: var example = true.


function debounce(func, wait) {
  var timeout;

  return function () {
    var context = this;
    var args = arguments;
    clearTimeout(timeout);

    timeout = setTimeout(function () {
      timeout = null;
      func.apply(context, args);
    }, wait);
  };
}