summaryrefslogtreecommitdiffstats
path: root/source-builder/sb/asciidoc/tests/data/testcases.txt
blob: 0678d5c1dacb575e155630c3c584d840e8c81ffb (plain) (blame)
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
//
// A collection of AsciiDoc test cases.
//

Test 'Cases'
============
:author: Joe Bloggs
// Web page meta data.
:title:       Test Cases
:keywords:    AsciiDoc, DocBook, EPUB, slideshow
:description: AsciiDoc is a text document format for writing short documents, +
              articles, books, slideshows and UNIX man pages.
:replacements.(\w)'(\w): \1’\2
:test-attribute: TEST_ATTRIBUTE


== Passthrough attributes ==
ifdef::basebackend-docbook[]
:passtest: pass:[<emphasis>*lorum ipsum*</emphasis>]
endif::basebackend-docbook[]
ifdef::basebackend-html[]
:passtest: pass:[<b>*lorum ipsum*</b>]
endif::basebackend-html[]
{passtest}

ifdef::basebackend-docbook[]
:passtest: pass:specialcharacters,quotes[<emphasis>*lorum ipsum*</emphasis>]
endif::basebackend-docbook[]
ifdef::basebackend-html[]
:passtest: pass:specialcharacters,quotes[<b>*lorum ipsum*</b>]
endif::basebackend-html[]
{passtest}


== Author attributes ==
\{eval:expression}, \{sys:command} and \{sys2:command}, \{counter:c1}

Hello *{author}* ({firstname} {lastname}, {authorinitials}).

{firstname,lastname,surname#}first name or last name or surname.

{firstname+lastname+surname#}first name and last name and surname.

{firstname+lastname#}first name and last name.


== System attributes ==
{counter:c1} {counter:c2:99} {counter:c3:A}

{c1} = 1, {c2} = 99, {c3} = A

{counter:c1} {counter:c2:99} {counter:c3:A}
{c1} {c2} {c3}

{c1} = 2, {c2} = 100, {c3} = B

{set:y:Foobar}
y: {y}

{set:y!}

y: {y}

:x: 3
:y: {eval:{x}+4}

{x}, {y}

{set:y:{x}}

{x}, {y}


== Quoted text attributes ==

A=_X_, (_X_), _X_, [_X_] _X_

A=*_X_*, (`_X_`), _`X`_, [*_X_*] +_X_+ _X_

// These two illustrate that nesting doesn't always work.
[_*X*_] _+X+_

[[_intro]]
<<_intro>> <<_intro,intro>> xref:_intro[] _intro_

// Quote attributes.
[foo]#fun with text#.
[foo bar]*fun with text*.
[foo]+fun with text+.
[foo]_fun with text_.
[foo]'fun with text'.
[foo]``fun with text''.
[foo]`fun with text'.

[foo]$$fun with text$$.

[foo]+++fun with text+++.

[red]#Obvious# and [big red yellow-background]*very obvious*.

[underline]#Underline text#, [overline]#overline text#
and [line-through]#line-through text#.

[firstletter]##T##esting 123 ...

(``+1\n+'') if (usually ``+-1\n+'')

(``++1\n++'') if (usually ``++-1\n++'')

(`{author}') and `{author}'


== Configuration attribute entries ==

:listdef-labeled.style: horizontal
term:: definition

:listdef-labeled.style: vertical
term:: definition

ifdef::backend-xhtml11[]
<<link1>>

:xref2-inlinemacro.: <a href="#{1}">{2?{2}}</a>

<<link1>>

:xref2-inlinemacro.: <a href="#{1}">{2=[{1}]}</a>
endif::[]


== role attribute ==

[role="test"]
Paragraph with a role attribute.

[role="test"]
- first
- second
- third


== Break list nesting ==
1. List 1.
2. List 1.

// New list.
a. List 2.
b. List 2.


== Listing Blocks ==
[subs="quotes"]
------------------------------------------
$ ls *-al*
------------------------------------------

[listing]
..........................................
[subs="quotes"]
------------------------------------------
$ ls *-al*
------------------------------------------
..........................................

.Listing
------------------------------------------
$ ls -al
------------------------------------------

.Listing example
==========================================
------------------------------------------
$ ls -al
------------------------------------------
==========================================

.Python paragraph
[source,python]
if n < 0: print 'Hello World!'

.Titled Python listing
[source,python]
------------------------------------------
if n < 0: print 'Hello World!'
------------------------------------------

.Python listing example
==========================================
[source,python]
------------------------------------------
if n < 0: print 'Hello World!'
------------------------------------------
==========================================


[[X1,anchor reftext]]
== Links ==
An [[X2]] inline anchor.
An [[X3, anchor reftext]] inline anchor with reftext.

<<X1>>; captioned link to <<X1,this test case>>.

<<X2>> link to inline anchor; captioned link to <<X2,inline anchor>>.

Link to <<X3>> anchor.

An example link to a bibliography entry <<Test::Unit>>.

[horizontal]
[[[Test::Unit]]]:: http://ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html


== Titles ==

[float]
===== Level 4 =====
[float]
==== Level 3 ====
[float]
=== Level 2 ===
[float]
== Level 1 ==
[float]
Level 4
+++++++
[float]
Level 3
^^^^^^^
[float]
Level 2
~~~~~~~
[float]
Level 1
-------

.Block title
Lorum ipsum.


== Lists ==

Bulleted:

- item text
* item text
** item text
*** item text
**** item text
***** item text

Numbered:

1. arabic (decimal) numbering
a. loweralpha numbering
A. upperalpha numbering
i) lowerroman numbering
I) upperroman numbering
. arabic (decimal) numbering
.. loweralpha numbering
... lowerroman numbering
.... upperalpha numbering
..... upperroman numbering

Labeled:

label:: item text
label;; item text
label::: item text
label:::: item text

With item anchor:

one:: Item one.
[[item_two]]two:: Item two.
three:: Item three.


== Inline passthroughs ==

- Test pass:[`ABC`].
- Test `pass:[ABC]`.
- The `++i` and `++j` auto-increments.
- Paths `~/.vim` and `~/docs`.
- The `__init__` method.
- The `{id}` attribute.

List start number test:

// The ol start attribute is not valid XHTML 1.1 (but it works in all
// browsers).
ifndef::backend-xhtml11[]
[start=7]
. List item 7.
. List item 8.
endif::backend-xhtml11[]

== Images

=== Block images

[[tiger_image]]
.Tyger tyger
image::../../images/tiger.png[Tyger tyger]

:height: 250
:width: 350
.Tyger tyger two
image::../../images/tiger.png[caption="Figure 2: ", alt="Tiger", align="center"]
:height!:
:width!:

// Images and icons directories.
:imagesdir: ../../doc
image::music2.png[]

:icons:
:iconsdir:  ../../images/icons
NOTE: Lorum ipsum.

:icons!:

ifdef::backend-xhtml11[]
:imagesdir: ../../images
:data-uri:
image:smallnew.png[NEW] 'testing' `123`.

endif::[]

:data-uri!:

=== Inline images

:imagesdir: ../../images

Inline image image:smallnew.png[]

Inline image image:smallnew.png[NEW!]

Inline image image:smallnew.png["NEW!",title="Small new"]


== Admonishments

NOTE: Lorum ipsum.

TIP: Lorum ipsum.

WARNING: Lorum ipsum.

CAUTION: Lorum ipsum.

IMPORTANT: Lorum ipsum.

// With icon images.
:icons:
:iconsdir:  ../../images/icons

NOTE: Lorum ipsum.

TIP: Lorum ipsum.

WARNING: Lorum ipsum.

CAUTION: Lorum ipsum.

IMPORTANT: Lorum ipsum.

:icons!:

== Backslash escapes

.Apostrophe
Don't vs don\'t.

.Exceptions
There are a number of  exceptions to the usual single backslash rule
-- mostly relating to URL macros that  have two syntaxes or quoting
ambiguity.  Here are some non-standard escape examples:

[cols="l,v",width="40%",options="header"]
|========================================
|AsciiDoc | Renders

2*|
\srackham@methods.co.nz
<\srackham@methods.co.nz>
\mailto:[\srackham@methods.co.nz]

2*|
\http://www.foo1.co.nz
\\http://www.foobar.com[]
\\http://www.foobar.com[Foobar Limited]

2*|
A C\++ Library for C++
\\``double-quotes''
\*\*F**ile Open\...
|========================================


== Paragraphs

.Normal paragraph
This is a *bold* a line
This is a 'strong' line
This is another _strong_ line

.Literal paragraph
[literal]
This is a *bold* a line
This is a 'strong' line
This is another _strong_ line

.Verse paragraph
[verse]
This is a *bold* a line
This is a 'strong' line
This is another _strong_ line

.Indented (literal) paragraph
  This is a *bold* a line
  This is a 'strong' line
  This is another _strong_ line

.Indented with quotes substitution
[subs="quotes"]
  This is a *bold* a line
  This is a 'strong' line
  This is another _strong_ line

.Literal paragraph with quotes substitution
["literal",subs="quotes"]
This is a *bold* a line
This is a 'strong' line
This is another _strong_ line

ifndef::basebackend-docbook[]
.Monospaced paragraph with line breaks
+This is a *bold* line+ +
+This is a 'strong' line+ +
+This is another _strong_ line+


.Another monospaced paragraph with line breaks
+This is a *bold* a line +
This is a 'strong' line +
This is another _strong_ line+

endif::basebackend-docbook[]

.Literal block with quotes substitution
[subs="quotes"]
.............................
This is a *bold* a line
This is a 'strong' line
This is another _strong_ line
.............................

[verse, William Blake, from Auguries of Innocence]
To see a world in a grain of sand,
And a heaven in a wild flower,
Hold infinity in the palm of your hand,
And eternity in an hour.

[quote, Bertrand Russell, The World of Mathematics (1956)]
A good notation has subtlety and suggestiveness which at times makes
it almost seem like a live teacher.


URLs
----
Mail Addresses
~~~~~~~~~~~~~~
joe_bloggs@mail_server.com_

joe-bloggs@mail-server.com.

joe-bloggs@mail-server.com,joe-bloggs@mail-server.com,

mailto:joe-bloggs@mail-server.com[Mail]

mailto:joe_bloggs@mail_server.com[Mail]

mailto:joe.bloggs@mail.server.com[Mail]

joe.bloggs@mail.server.com +
lorum ipsum.


Comments
--------
/////////////////////////////////////////////////////////////////////
A comment
block.
/////////////////////////////////////////////////////////////////////

// This is a comment line.

Qui in magna commodo, est labitur dolorum an. Est ne magna primis.
// Inline comment line.
adolescens. Sit munere ponderum dignissim et. Minim luptatum et.

:showcomments:
// This comment line will be displayed in the output.

Qui in magna commodo, est labitur dolorum an. Est ne magna primis.
// Visible inline comment line.
adolescens. Sit munere ponderum dignissim et. Minim luptatum et.

/////////////////////////////////////////////////////////////////////
Comment blocks are never displayed in the output.
/////////////////////////////////////////////////////////////////////

:showcomments!:

[[comment_macro]]
.Block title
// Block macro comment does not consume titles or attributes.
Lorum ipsum.

[[comment_block]]
.Block title
/////////////////////////////////////////////////////////////////////
Delimited comment block does not consume titles or attributes.
/////////////////////////////////////////////////////////////////////
Lorum ipsum.


ifdef::basebackend-docbook[]
[glossary]
List of terms
-------------
Using positional attribute to specify section template.

[glossary]
A glossary term::
  The corresponding (indented) definition.

A second glossary term::
  The corresponding (indented) definition.

[template="glossary"]
List of terms
-------------
Using named 'template' attribute to specify section template.

[glossary]
A glossary term::
  The corresponding (indented) definition.

A second glossary term::
  The corresponding (indented) definition.

endif::basebackend-docbook[]

Index Terms
-----------
Multi-passthough substitution (see
http://groups.google.com/group/asciidoc/browse_frm/thread/1269dc2feb1a482c)
((`foo`))
(((foo,`bar`)))
(((foo,`bar`,`two`)))

Table with fractional column width units
----------------------------------------
NOTE: 'pagewidth' and 'pageunits' only apply to DocBook outputs.

:miscellaneous.pagewidth: 17.5
:miscellaneous.pageunits: cm

.Horizontal and vertical source data
[width="50%",cols="3,^2,^2,10",options="header"]
|=========================================================
|Date |Duration |Avg HR |Notes

|22-Aug-08 |10:24 | 157 |
Worked out MSHR (max sustainable heart rate) by going hard
for this interval.

|22-Aug-08 |23:03 | 152 |
Back-to-back with previous interval.

|24-Aug-08 |40:00 | 145 |
Moderately hard interspersed with 3x 3min intervals (2min
hard + 1min really hard taking the HR up to 160).

|=========================================================

== Table with parent configuration file and header attribute entry

[cols="asciidoc"]
|====
|
- Attribute entry from header: {test-attribute}
- Replacement from `testcases.conf` configuration file: test-replacement
|====

== Table column specifiers with merged cells
See
http://groups.google.com/group/asciidoc/browse_thread/thread/c9238380a1f2507a

[cols="<1m,>1,^1s, ^1e"]
|============================================
 .2+|        .2+|1- A     2+|2- B
                            |i- a      |ii- b
    |Values 1   |v1         |v2        |v3
    |Values 2   |v4         |v5        |v6
|============================================

Floating tables and images
--------------------------
.Simple table
[float="left",width="15%"]
|=======
|1 |2 |A
|3 |4 |B
|5 |6 |C
|=======

.Tiger
[float="right"]
image::images/tiger.png["Tiger image"]

unfloat::[]

Section level offsets
---------------------
At level 1

:leveloffset: -1
Section title
^^^^^^^^^^^^^
At level 2

:leveloffset: 0
Section title
~~~~~~~~~~~~~
At level 2

:leveloffset: 2
Section title
-------------
At level 3

:leveloffset!:
:numbered!:

Section level offsets
---------------------
At level 1

Single-quoted attributes
------------------------
[quote,'http://en.wikipedia.org/wiki/Samuel_Johnson[Samuel Johnson]']
_____________________________________________________________________
Sir, a woman's preaching is like a dog's walking on his hind legs. It
is not done well; but you are surprised to find it done at all.
_____________________________________________________________________

["quote","'http://en.wikipedia.org/wiki/Samuel_Johnson[Samuel Johnson]'"]
_____________________________________________________________________
Sir, a woman's preaching is like a dog's walking on his hind legs. It
is not done well; but you are surprised to find it done at all.
_____________________________________________________________________

Footnotes
---------
Qui in magna commodo, est labitur dolorum an. Est ne magna primis
adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel.
footnote:[footnote one.
Qui in magna commodo, est labitur dolorum an. Est ne magna primis
adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel.
Qui in magna commodo, est labitur dolorum an. Est ne magna primis
adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel.]
Qui in magna commodo, est labitur dolorum an. Est ne magna primis
adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel.
footnoteref:["F2","footnote two.
Qui in magna commodo, est labitur dolorum an. Est ne magna primis
adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel."]
Qui in magna commodo, est labitur dolorum an. Est ne magna primis
adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel
footnoteref:[F2].
Qui in magna commodo, est labitur dolorum an. Est ne magna primis
adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel.
footnote:[http://www.methods.co.nz/asciidoc/ Qui in magna commodo,
est labitur dolorum an. Est ne magna primis adolescens. Sit munere
ponderum dignissim et. Minim luptatum et vel
image:images/smallnew.png[]]
Qui in magna commodo, est labitur dolorum an. Est ne magna primis
adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel.
footnote:[http://www.methods.co.nz/asciidoc/]
Qui in magna commodo, est labitur dolorum an. Est ne magna primis
adolescens. Sit munere ponderum dignissim et. Minim luptatum et
vel footnote:[http://www.methods.co.nz/asciidoc/[AsciiDoc website].].
Qui in magna commodo, est labitur dolorum an. Est ne magna primis
adolescens. Sit munere ponderum dignissim et. Minim luptatum et
footnoteref:[F3,A footnote&#44; &#34;with an image&#34;
image:images/smallnew.png[]].
footnote:[With [square brackets\]] Qui in magna commodo, est labitur
dolorum an. Est ne magna primis.


Rulers and page breaks
----------------------

Lorum ipsum...

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Lorum ipsum...

<<<

Lorum ipsum...


这是一个测试
------------
Double-with character titles.
<<_这是一个测试,link to auto-generated section ID>>.


ifdef::backend-html5[]
HTML 5 audio and video block macros
-----------------------------------
audio::images/example.ogg[]

.Audio tag test
audio::images/example.ogg[]

video::images/gizmo.ogv[width=200,options="nocontrols,autoplay"]

.Example video
video::images/gizmo.ogv[]

video::http://www.808.dk/pics/video/gizmo.ogv[]

++++
<video poster="images/gizmo.jpg" id="video" style="cursor: pointer;" >
  <source src="images/gizmo.webm" type="video/webm" />
  <source src="images/gizmo.ogv" type="video/ogg" />
  Video not playing? <a href="images/gizmo.mp4">Download file</a> instead.
</video>

<script type="text/javascript">
  var video = document.getElementById('video');
  video.addEventListener('click',function(){
    video.play();
  },false);
</script>
++++

endif::backend-html5[]


== Block macros

:rs458: 2

ifeval::[{rs458}==2]
RS458 is 2.
endif::[]
ifeval::[not ({rs458}==2)]
This will not be processed.
endif::[]

// Test eval block macro.
eval::[Section.setlevel(1)]

// Test template concatenation.
{template:test-template}

// Test ascii-ids attribute.
:ascii-ids:
== àn îd without accénts
Lorum ipsum...

:ascii-ids!:
== àn îd with accénts
Lorum ipsum...


== Inline macros
http://groups.google.com/group/asciidoc/[A URL with [square
brackets\]].