深度阅读

"Syntax Highlighting Test"

作者
作者
2023年08月22日
更新时间
6.33 分钟
阅读时间
0
阅读量

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. /

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。