-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtest_text_uri.ml
53 lines (52 loc) · 1.74 KB
/
test_text_uri.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
let b =
let open PrintBox in
vlist
[
link ~uri:"#SecondAnchor" @@ frame
@@ text "Link to a within-document anchor";
link ~uri:"https://example.com/1" @@ frame @@ text "child 1";
link ~uri:"https://example.com/2" @@ text "child 2";
frame
@@ tree
(link ~uri:"https://example.com/3" empty)
[
link ~uri:"https://example.com/4"
@@ tree (frame @@ text "header 3") [ frame @@ text "subchild 3" ];
];
link ~uri:"https://example.com/5"
@@ tree empty
[ tree (frame @@ text "header 4") [ frame @@ text "subchild 4" ] ];
frame @@ text "child 5";
link ~uri:"https://example.com/6"
@@ frame
@@ tree
(frame @@ text "header 6")
[
tree
(frame @@ text "child 6")
[
link ~uri:"https://example.com/7" @@ frame @@ text "subchild 6";
];
];
anchor ~id:"FirstAnchor" @@ frame @@ text "anchor self-link 1";
tree
(hlist ~bars:false
[ anchor ~id:"SecondAnchor" empty; text "silent anchor" ])
[ text "subchild 7" ];
tree
(hlist ~bars:false
[
anchor ~id:"ThirdAnchor" @@ text "anchor self-link 2";
text " after anchor link 2";
])
[ text "subchild 8" ];
hlist ~bars:false
[
link ~uri:"https://example.com/8" @@ text "external link 8";
text " after external link 8";
];
]
let () = print_endline "Output with ANSI styling:"
let () = print_endline @@ PrintBox_text.to_string b
let () = print_endline "Output without ANSI styling:"
let () = print_endline @@ PrintBox_text.to_string_with ~style:false b