Default / 默认 · 8月 31, 2021

“Syntax Highlighting Test”

内容纲要

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. /
{% endhighlight %}

%d 博主赞过: