"Syntax Highlighting Test"

Published on Aug. 22, 2023, 12:03 p.m.

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

Ruby:
{% highlight ruby %}
def print_hi(name)
puts “Hi, #{name}”
end
print_hi(‘Tom’)

=> prints ‘Hi, Tom’ to STDOUT.

{% endhighlight %}

Python with line numbers:
{% highlight python linenos %}
def print_hi(name):
print(“Hi, {}”.format(name))

print_hi(‘Tom’)

prints ‘Hi, Tom’ to STDOUT.

{% endhighlight %}

C with line numbers:
{% highlight c linenos %}
void print_hi(string name) {
printf(“Hi, %s”, name);
}
print_hi(“Tom”);
/ prints ‘Hi, Tom’ to STDOUT. /