代码高亮测试

一篇用于测试博客模板代码高亮的演示

Syntax highlighting is a feature that displays source code, in different colors and fonts according to the category of terms. This feature facilitates writing in a structured language such as a programming language or a markup language as both structures and syntax errors are visually distinct. Highlighting does not affect the meaning of the text itself; it is intended only for human readers.1

Pygments高亮代码块

C

#include <stdio.h>
int main(void)
{
    printf("Hello World\n");
    return 0;
}

Java

1 class helloworld
2 {
3     public static void main(String args[])
4     {
5         System.out.println("Hello World");
6     }
7 }

标准代码块

Python

#!/usr/bin/python
printf("Hello World")

行内代码

Bash

echo "Hello World"



版权声明:自由转载-非商用-非衍生-保持署名 tunnyios 本文永久链接: http://tunnyios.github.io/sample-post/code-highlighting