@@ -32,30 +32,32 @@ following way:
3232
3333The basic feature of this library is that it allows you to write to a
3434GraphViz output file or to a GraphViz viewer by simply writing to a
35- Prolog output stream. The following example shows how to write a
36- graph consisting of one node, and open the result in a GraphViz
37- viewer:
35+ Prolog output stream. The following example (see
36+ [ ` example/hello.pl ` ] ( example/hello.pl ) ) shows how to write a graph
37+ consisting of one node, and open the result in a GraphViz viewer:
3838
3939``` pl
4040?- gv_view([Out]>>format(Out, " x [label=<Hello,<BR/>world!>,shape=diamond];\n " , [])).
4141```
4242
4343This opens the following image inside a GraphViz-compatible viewer:
4444
45- ![ ] ( ./ example/hello.svg)
45+ ![ ] ( example/hello.svg )
4646
4747### Exporting a single edge
4848
49- In this example we write a graph that consists of a single edge:
49+ In this example (see [ ` example/loves.pl ` ] ( example/loves.pl ) ) we write
50+ a graph that consists of a single edge:
5051
5152``` pl
52- ?- gv_export(' loves.svg' , [Out]>>format(Out, " John -- Mary [label=loves]" , [])).
53+ ?- gv_export(' loves.svg' , [Out]>>format(Out, " John -- Mary [label=loves]; \n " , [])).
5354```
5455
5556This writes the following image to an SVG file. See the table in
56- Section [[ Output formats]] for a full list of supported output formats.
57+ Section [ Output formats] ( #output-formats-option-format1 ) for a full
58+ list of supported output formats.
5759
58- ![ ] ( ./ example/loves.svg)
60+ ![ ] ( example/loves.svg )
5961
6062## Advanced use
6163
@@ -70,24 +72,26 @@ library's support predicates. The most important ones are:
7072` dot_arc/4 ` and ` dot_edge/4 ` take a list of options that are emitted
7173as GraphViz attributes. Option ` label(+or([string,list(string)])) `
7274allows (multi-line) Unicode labels to be emitted using HTML-like
73- labels (see Section [[ HTML-like labels]] ).
75+ labels (see Section [ HTML-like labels] ( #html-like-labels ) ).
7476
7577### Exporting a proof tree
7678
7779Suppose your program returns proof trees that consist of an entailment
7880rule label, a conclusion, and an arbitrary number of premises:
7981
8082``` pl
81- ?- Proof = t(rdfs(3),isa (class,class),[t(axiom(rdfs),range(range,class),[]),
82- t(axiom(rdfs),range(subClassOf ,class),[])]).
83+ ?- Proof = t(rdfs(3),∈ (class,class),[t(axiom(rdfs),range(range,class),[]),
84+ t(axiom(rdfs),range(⊆ ,class),[])]).
8385```
8486
85- The following program exports such proof trees. Notice that this
86- program uses the support predicates. This allows the nodes to be
87- characterized by Prolog terms instead of DOT IDs. For most programs
88- this results in simplified code because. Since these support
89- predicates are idempotent, emitting the same node/edge multiple times
90- does not accidentally change the exported graph.
87+ The following program (see
88+ [ ` example/proof_tree.pl ` ] ( example/proof_tree.pl ) ) exports such proof
89+ trees. Notice that this program uses the support predicates. This
90+ allows the nodes to be characterized by Prolog terms instead of DOT
91+ IDs. For most programs this results in simplified code because.
92+ Since these support predicates are idempotent, emitting the same
93+ node/edge multiple times does not accidentally change the exported
94+ graph.
9195
9296``` pl
9397:- use_module(library(apply)).
@@ -123,7 +127,7 @@ GraphViz-compatible viewer, we make the following call:
123127
124128This produces the following visualization:
125129
126- ![ ] ( ./ example/proof_tree.svg)
130+ ![ ] ( example/proof_tree.svg )
127131
128132### Exporting a parse trees
129133
@@ -134,7 +138,7 @@ Suppose your program returns syntactic parse trees like the following:
134138```
135139
136140The following code exports such parse trees to SVG (see
137- ` example/parse_tree.pl ` ):
141+ [ ` example/parse_tree.pl ` ] ( example/parse_tree.pl ) ):
138142
139143``` pl
140144:- use_module(library(apply)).
@@ -166,7 +170,7 @@ by making the following call:
166170
167171This prodices the following result:
168172
169- ![ ] ( ./ example/parse_tree.svg)
173+ ![ ] ( example/parse_tree.svg )
170174
171175Notice that we create a new DOT ID (` dot_id/1 ` ) for each node in the
172176tree. Because of this, the two occurrences of ‘the’ can be
0 commit comments