Skip to content

Commit 88cfc73

Browse files
committed
[update] use sphinx_rtd_theme
Signed-off-by: PythonShell <pythonshell@yeah.net>
1 parent d4500d3 commit 88cfc73

6 files changed

Lines changed: 55 additions & 5 deletions

File tree

_static/examples/embedhtml.dot

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
digraph html {
2+
abc [shape=none, margin=0, label=<
3+
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
4+
<TR><TD ROWSPAN="3"><FONT COLOR="red">hello</FONT><BR/>world</TD> 5: <TD COLSPAN="3">b</TD>
5+
<TD ROWSPAN="3" BGCOLOR="lightgrey">g</TD>
6+
<TD ROWSPAN="3">h</TD>
7+
</TR>
8+
<TR><TD>c</TD>
9+
<TD PORT="here">d</TD>
10+
<TD>e</TD>
11+
</TR>
12+
<TR><TD COLSPAN="3">f</TD> 14: </TR>
13+
</TABLE>
14+
>];
15+
}

_static/examples/embedhtml.jpg

6.41 KB
Loading

_static/examples/network01.dot

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
graph network {
2+
rankdir = LR;
3+
{
4+
node [shape=circle];
5+
0 -- 1;
6+
0 -- 2;
7+
1 -- 2;
8+
1 -- 3;
9+
2 -- 3;
10+
3 -- 4;
11+
4 -- 5;
12+
5 -- 6;
13+
5 -- 7;
14+
6 -- 8;
15+
7 -- 8;
16+
8 -- 9;
17+
}
18+
{ rank=same; 1; 2; }
19+
{ rank=same; 6; 7; }
20+
}

_static/examples/network01.jpg

17.1 KB
Loading

chap01.rst

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,18 @@ Graphviz 编译的源文件是 dot 文件,把如下的代码保存到 graph01.
2121
}
2222
2323
24-
使用命令 `dot -Tjpg graph01.dot -o graph01.jpg` 编译,可以得到名为 graph01.jpg
24+
使用命令 :code:`dot -Tjpg graph01.dot -o graph01.jpg` 编译,可以得到名为 graph01.jpg
2525
的图片,图片内容如下所示。
2626

2727
.. image:: _static/examples/graph01.jpg
2828

29+
在上述的 dot 文件中,定义了一个名为 G 的有向图( digraph 是有向图的意思),\
30+
有向图的具体内容紧随定义后的花括号内。花括号体内,定义了点( node )到点的线\
31+
段( edge )。每一行,以英文分号(;)结尾的整行,定义的是一条连接两个或多个点的有\
32+
向线段,比如 :code:`main -> parse -> execute` 定义了一条历经三个点\
33+
(:code:`main`, :code:`parse`, :code:`execute`)的有向线段。 :code:`->` 定义了线\
34+
段的方向。
35+
2936

3037
1.2 让有向图更复杂点
3138
------------------------------------------------------------------------------
@@ -52,7 +59,7 @@ Graphviz 可以给点(node)或者线(edge)添加格式。
5259
execute -> compare;
5360
}
5461
55-
使用命令 `dot -Tjpg graph02.dot -o graph02.jpg` 可以得到如下的图片:
62+
使用命令 :code:`dot -Tjpg graph02.dot -o graph02.jpg` 可以得到如下的图片:
5663

5764
.. image:: _static/examples/graph02.jpg
5865

@@ -74,7 +81,7 @@ Graphviz 支持 UTF8 下的中文。
7481
Footman -> 刀塔;
7582
}
7683
77-
使用命令 `dot -Tjpg graph03.dot -o graph03.jpg` 可以得到如下的图片:
84+
使用命令 :code:`dot -Tjpg graph03.dot -o graph03.jpg` 可以得到如下的图片:
7885

7986
.. image:: _static/examples/graph03.jpg
8087

@@ -101,6 +108,12 @@ Graphviz 支持 UTF8 下的中文。
101108
.. image:: _static/examples/graph04.jpg
102109

103110

104-
1.5
111+
1.5 内置颜色
105112
------------------------------------------------------------------------------
106113

114+
这里列出了基本的颜色,更多信息请参看 `Graphviz Colors`_ 和 `Graphviz Attrs`_ 。
115+
116+
117+
.. _Graphviz Colors: http://www.graphviz.org/doc/info/colors.html
118+
.. _Graphviz Attrs: http://www.graphviz.org/doc/info/attrs.html#k:color
119+

conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#import cloud_sptheme as csp
2424
#import sphinx_bootstrap_theme
25+
import sphinx_rtd_theme
2526

2627

2728
# -- General configuration ------------------------------------------------
@@ -94,7 +95,8 @@
9495
# a list of builtin themes.
9596
#
9697
#html_theme = 'alabaster'
97-
html_theme = 'sphinxdoc'
98+
#html_theme = 'sphinxdoc'
99+
html_theme = 'sphinx_rtd_theme'
98100

99101
# Cloud Theme
100102
#html_theme = 'cloud'

0 commit comments

Comments
 (0)