5. 显示代码

Note

我们可以在配置文件指定highlight_langeuage=”c,python”

5.1. 使用codeblock

#include<stdio.h>
int main()
{
    printf("%s\n","aaaa");
    return 0;
}

5.2. 显示行号

1#include<stdio.h>
2int main()
3{
4    printf("%s\n","aaaa");
5    return 0;
6}

5.3. 突出特定行

def some_function():
    interesting = False
    print 'This line is highlighted.'
    print 'This one is not...'
    print '...but this one is.'

5.4. 引用一个文件

 1import sys
 2
 3def test1():
 4    print("test")
 5
 6def test3():
 7    print("test")
 8
 9def test4():
10    print("test")

5.5. diff2个文件

--- C:\Users\gn\OneDrive\100-gnblog[github_repo]\scibro\source\doc\Scientific_tips\rst_tutories\mark\test2.py
+++ C:\Users\gn\OneDrive\100-gnblog[github_repo]\scibro\source\doc\Scientific_tips\rst_tutories\mark\test.py
@@ -1,12 +1,13 @@
 import sys
-import os
 
 def test1():
-    print("test3")
+    print("test")
 
 def test2():
-    print("test2")
+    print("test")
 
+def test3():
+    print("test")
 
 def test4():
-    print("test4")+    print("test")