menu

Syntax Highlighting Test

Jekyll uses Rouge by default for syntax highlighting, here are some tests.

Ruby:

def print_hi(name)
  puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.

Python with line numbers:

1
2
3
4
5
def print_hi(name):
    print("Hi, {}".format(name))

print_hi('Tom')
# prints 'Hi, Tom' to STDOUT.

C with line numbers:

1
2
3
4
5
void print_hi(string name) {
  printf("Hi, %s", name);
}
print_hi("Tom");
/* prints 'Hi, Tom' to STDOUT. */
编辑