summaryrefslogtreecommitdiff
path: root/tests/note/testscript
blob: c51b935972b2e8fae079de2a8bbb30e4406ea681 (plain)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# file      : tests/note/testscript
# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC
# license   : MIT; see accompanying LICENSE file

test = $effect($cli.path)

: block-basics
:
cat <<EOI >=test.cli;
"
Leading paragraph.

\N|This is a note block one.|

Interleaving paragraph that is quite long and therefore it may span many
lines in order to make text easy to read.

\N|This is a note block two that is quite long and therefore it may span many
lines in order to make text easy to read.|

Trailing paragraph.
"
EOI
$* --generate-html --stdout test.cli >>EOO;
  <p>Leading paragraph.</p>

  <div class="note">
  <p>This is a note block one.</p>
  </div>

  <p>Interleaving paragraph that is quite long and therefore it may span many
  lines in order to make text easy to read.</p>

  <div class="note">
  <p>This is a note block two that is quite long and therefore it may span
  many lines in order to make text easy to read.</p>
  </div>

  <p>Trailing paragraph.</p>

EOO
  $* --generate-txt --stdout test.cli >>EOO
Leading paragraph.

| This is a note block one.

Interleaving paragraph that is quite long and therefore it may span many lines
in order to make text easy to read.

| This is a note block two that is quite long and therefore it may span many
| lines in order to make text easy to read.

Trailing paragraph.
EOO


: block-multi-para
:
cat <<EOI >=test.cli;
"
\N|
This is a note para one that is quite long and therefore it may span many
lines in order to make text easy to read.

This is a note para two.
|
"
EOI
$* --generate-html --stdout test.cli >>EOO;
  <div class="note">
  <p>This is a note para one that is quite long and therefore it may span many
  lines in order to make text easy to read.</p>

  <p>This is a note para two.</p>
  </div>

EOO
$* --generate-txt --stdout test.cli >>EOO
| This is a note para one that is quite long and therefore it may span many
| lines in order to make text easy to read.
|
| This is a note para two.
EOO

: block-pre
:
cat <<EOI >=test.cli;
"

\N|
This is a note para one.

\
And this is a
pre-formatter text fragment.
\

|
"
EOI
$* --generate-html --stdout test.cli >>EOO;
  <div class="note">
  <p>This is a note para one.</p>

  <pre>And this is a
pre-formatter text fragment.</pre>
  </div>

EOO
$* --generate-txt --stdout test.cli >>EOO
| This is a note para one.
|
| And this is a
| pre-formatter text fragment.
EOO

# This is not yet supported (see txt_wrap_lines()).
#
#\
: block-list
:
cat <<EOI >=test.cli;
"
\N|This is a note para one followed by a list.

\ul|

\li|This is a list item that is quite long and therefore it may span many
lines in order to make text easy to read.|||
"
EOI
$* --generate-html --stdout test.cli >>EOO;
EOO
$* --generate-txt --stdout test.cli >>EOO
EOO
#\

: block-in-list
:
cat <<EOI >=test.cli;
"
\ul|

\li|Normal text para.

\N|This is a note para one that is quite long and therefore it may span many
lines in order to make text easy to read.|||
"
EOI
$* --generate-html --stdout test.cli >>EOO;
  <ul>
  <li>Normal text para.

  <div class="note">
  <p>This is a note para one that is quite long and therefore it may span many
  lines in order to make text easy to read.</p>
  </div></li>
  </ul>

EOO
$* --generate-txt --stdout test.cli >>EOO
* Normal text para.

  | This is a note para one that is quite long and therefore it may span many
  | lines in order to make text easy to read.
EOO


: span-basics
:
cat <<EOI >=test.cli;
"
This is normal text. \N{This is a note.} And this is normal text again.
"
EOI
$* --generate-html --stdout test.cli >>EOO;
  <p>This is normal text. <span class="note">This is a note.</span> And this
  is normal text again.</p>

EOO
  $* --generate-txt --stdout test.cli >>EOO
This is normal text. [Note: This is a note.] And this is normal text again.
EOO


: span-nested-link
:
cat <<EOI >=test.cli;
"
\N{This is a note with a \l{https://example.com link} inside.}
"
EOI
$* --generate-html --stdout test.cli >>EOO;
  <p><span class="note">This is a note with a <a
  href="https://example.com">link</a> inside.</span></p>

EOO
$* --generate-txt --stdout test.cli >>EOO
[Note: This is a note with a link (https://example.com) inside.]
EOO