source: rtems-tools/doc/asciidoc/tests/data/testcases.txt @ f91e023

4.104.115
Last change on this file since f91e023 was f91e023, checked in by Chris Johns <chrisj@…>, on 02/17/14 at 07:04:46

Add the documentation.

  • Property mode set to 100644
File size: 16.8 KB
Line 
1//
2// A collection of AsciiDoc test cases.
3//
4
5Test 'Cases'
6============
7:author: Joe Bloggs
8// Web page meta data.
9:title:       Test Cases
10:keywords:    AsciiDoc, DocBook, EPUB, slideshow
11:description: AsciiDoc is a text document format for writing short documents, +
12              articles, books, slideshows and UNIX man pages.
13:replacements.(\w)'(\w): \1&#8217;\2
14:test-attribute: TEST_ATTRIBUTE
15
16
17== Passthrough attributes ==
18ifdef::basebackend-docbook[]
19:passtest: pass:[<emphasis>*lorum ipsum*</emphasis>]
20endif::basebackend-docbook[]
21ifdef::basebackend-html[]
22:passtest: pass:[<b>*lorum ipsum*</b>]
23endif::basebackend-html[]
24{passtest}
25
26ifdef::basebackend-docbook[]
27:passtest: pass:specialcharacters,quotes[<emphasis>*lorum ipsum*</emphasis>]
28endif::basebackend-docbook[]
29ifdef::basebackend-html[]
30:passtest: pass:specialcharacters,quotes[<b>*lorum ipsum*</b>]
31endif::basebackend-html[]
32{passtest}
33
34
35== Author attributes ==
36\{eval:expression}, \{sys:command} and \{sys2:command}, \{counter:c1}
37
38Hello *{author}* ({firstname} {lastname}, {authorinitials}).
39
40{firstname,lastname,surname#}first name or last name or surname.
41
42{firstname+lastname+surname#}first name and last name and surname.
43
44{firstname+lastname#}first name and last name.
45
46
47== System attributes ==
48{counter:c1} {counter:c2:99} {counter:c3:A}
49
50{c1} = 1, {c2} = 99, {c3} = A
51
52{counter:c1} {counter:c2:99} {counter:c3:A}
53{c1} {c2} {c3}
54
55{c1} = 2, {c2} = 100, {c3} = B
56
57{set:y:Foobar}
58y: {y}
59
60{set:y!}
61
62y: {y}
63
64:x: 3
65:y: {eval:{x}+4}
66
67{x}, {y}
68
69{set:y:{x}}
70
71{x}, {y}
72
73
74== Quoted text attributes ==
75
76A=_X_, (_X_), _X_, [_X_] _X_
77
78A=*_X_*, (`_X_`), _`X`_, [*_X_*] +_X_+ _X_
79
80// These two illustrate that nesting doesn't always work.
81[_*X*_] _+X+_
82
83[[_intro]]
84<<_intro>> <<_intro,intro>> xref:_intro[] _intro_
85
86// Quote attributes.
87[foo]#fun with text#.
88[foo bar]*fun with text*.
89[foo]+fun with text+.
90[foo]_fun with text_.
91[foo]'fun with text'.
92[foo]``fun with text''.
93[foo]`fun with text'.
94
95[foo]$$fun with text$$.
96
97[foo]+++fun with text+++.
98
99[red]#Obvious# and [big red yellow-background]*very obvious*.
100
101[underline]#Underline text#, [overline]#overline text#
102and [line-through]#line-through text#.
103
104[firstletter]##T##esting 123 ...
105
106(``+1\n+'') if (usually ``+-1\n+'')
107
108(``++1\n++'') if (usually ``++-1\n++'')
109
110(`{author}') and `{author}'
111
112
113== Configuration attribute entries ==
114
115:listdef-labeled.style: horizontal
116term:: definition
117
118:listdef-labeled.style: vertical
119term:: definition
120
121ifdef::backend-xhtml11[]
122<<link1>>
123
124:xref2-inlinemacro.: <a href="#{1}">{2?{2}}</a>
125
126<<link1>>
127
128:xref2-inlinemacro.: <a href="#{1}">{2=[{1}]}</a>
129endif::[]
130
131
132== role attribute ==
133
134[role="test"]
135Paragraph with a role attribute.
136
137[role="test"]
138- first
139- second
140- third
141
142
143== Break list nesting ==
1441. List 1.
1452. List 1.
146
147// New list.
148a. List 2.
149b. List 2.
150
151
152== Listing Blocks ==
153[subs="quotes"]
154------------------------------------------
155$ ls *-al*
156------------------------------------------
157
158[listing]
159..........................................
160[subs="quotes"]
161------------------------------------------
162$ ls *-al*
163------------------------------------------
164..........................................
165
166.Listing
167------------------------------------------
168$ ls -al
169------------------------------------------
170
171.Listing example
172==========================================
173------------------------------------------
174$ ls -al
175------------------------------------------
176==========================================
177
178.Python paragraph
179[source,python]
180if n < 0: print 'Hello World!'
181
182.Titled Python listing
183[source,python]
184------------------------------------------
185if n < 0: print 'Hello World!'
186------------------------------------------
187
188.Python listing example
189==========================================
190[source,python]
191------------------------------------------
192if n < 0: print 'Hello World!'
193------------------------------------------
194==========================================
195
196
197[[X1,anchor reftext]]
198== Links ==
199An [[X2]] inline anchor.
200An [[X3, anchor reftext]] inline anchor with reftext.
201
202<<X1>>; captioned link to <<X1,this test case>>.
203
204<<X2>> link to inline anchor; captioned link to <<X2,inline anchor>>.
205
206Link to <<X3>> anchor.
207
208An example link to a bibliography entry <<Test::Unit>>.
209
210[horizontal]
211[[[Test::Unit]]]:: http://ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html
212
213
214== Titles ==
215
216[float]
217===== Level 4 =====
218[float]
219==== Level 3 ====
220[float]
221=== Level 2 ===
222[float]
223== Level 1 ==
224[float]
225Level 4
226+++++++
227[float]
228Level 3
229^^^^^^^
230[float]
231Level 2
232~~~~~~~
233[float]
234Level 1
235-------
236
237.Block title
238Lorum ipsum.
239
240
241== Lists ==
242
243Bulleted:
244
245- item text
246* item text
247** item text
248*** item text
249**** item text
250***** item text
251
252Numbered:
253
2541. arabic (decimal) numbering
255a. loweralpha numbering
256A. upperalpha numbering
257i) lowerroman numbering
258I) upperroman numbering
259. arabic (decimal) numbering
260.. loweralpha numbering
261... lowerroman numbering
262.... upperalpha numbering
263..... upperroman numbering
264
265Labeled:
266
267label:: item text
268label;; item text
269label::: item text
270label:::: item text
271
272With item anchor:
273
274one:: Item one.
275[[item_two]]two:: Item two.
276three:: Item three.
277
278
279== Inline passthroughs ==
280
281- Test pass:[`ABC`].
282- Test `pass:[ABC]`.
283- The `++i` and `++j` auto-increments.
284- Paths `~/.vim` and `~/docs`.
285- The `__init__` method.
286- The `{id}` attribute.
287
288List start number test:
289
290// The ol start attribute is not valid XHTML 1.1 (but it works in all
291// browsers).
292ifndef::backend-xhtml11[]
293[start=7]
294. List item 7.
295. List item 8.
296endif::backend-xhtml11[]
297
298== Images
299
300=== Block images
301
302[[tiger_image]]
303.Tyger tyger
304image::../../images/tiger.png[Tyger tyger]
305
306:height: 250
307:width: 350
308.Tyger tyger two
309image::../../images/tiger.png[caption="Figure 2: ", alt="Tiger", align="center"]
310:height!:
311:width!:
312
313// Images and icons directories.
314:imagesdir: ../../doc
315image::music2.png[]
316
317:icons:
318:iconsdir:  ../../images/icons
319NOTE: Lorum ipsum.
320
321:icons!:
322
323ifdef::backend-xhtml11[]
324:imagesdir: ../../images
325:data-uri:
326image:smallnew.png[NEW] 'testing' `123`.
327
328endif::[]
329
330:data-uri!:
331
332=== Inline images
333
334:imagesdir: ../../images
335
336Inline image image:smallnew.png[]
337
338Inline image image:smallnew.png[NEW!]
339
340Inline image image:smallnew.png["NEW!",title="Small new"]
341
342
343== Admonishments
344
345NOTE: Lorum ipsum.
346
347TIP: Lorum ipsum.
348
349WARNING: Lorum ipsum.
350
351CAUTION: Lorum ipsum.
352
353IMPORTANT: Lorum ipsum.
354
355// With icon images.
356:icons:
357:iconsdir:  ../../images/icons
358
359NOTE: Lorum ipsum.
360
361TIP: Lorum ipsum.
362
363WARNING: Lorum ipsum.
364
365CAUTION: Lorum ipsum.
366
367IMPORTANT: Lorum ipsum.
368
369:icons!:
370
371== Backslash escapes
372
373.Apostrophe
374Don't vs don\'t.
375
376.Exceptions
377There are a number of  exceptions to the usual single backslash rule
378-- mostly relating to URL macros that  have two syntaxes or quoting
379ambiguity.  Here are some non-standard escape examples:
380
381[cols="l,v",width="40%",options="header"]
382|========================================
383|AsciiDoc | Renders
384
3852*|
386\srackham@methods.co.nz
387<\srackham@methods.co.nz>
388\mailto:[\srackham@methods.co.nz]
389
3902*|
391\http://www.foo1.co.nz
392\\http://www.foobar.com[]
393\\http://www.foobar.com[Foobar Limited]
394
3952*|
396A C\++ Library for C++
397\\``double-quotes''
398\*\*F**ile Open\...
399|========================================
400
401
402== Paragraphs
403
404.Normal paragraph
405This is a *bold* a line
406This is a 'strong' line
407This is another _strong_ line
408
409.Literal paragraph
410[literal]
411This is a *bold* a line
412This is a 'strong' line
413This is another _strong_ line
414
415.Verse paragraph
416[verse]
417This is a *bold* a line
418This is a 'strong' line
419This is another _strong_ line
420
421.Indented (literal) paragraph
422  This is a *bold* a line
423  This is a 'strong' line
424  This is another _strong_ line
425
426.Indented with quotes substitution
427[subs="quotes"]
428  This is a *bold* a line
429  This is a 'strong' line
430  This is another _strong_ line
431
432.Literal paragraph with quotes substitution
433["literal",subs="quotes"]
434This is a *bold* a line
435This is a 'strong' line
436This is another _strong_ line
437
438ifndef::basebackend-docbook[]
439.Monospaced paragraph with line breaks
440+This is a *bold* line+ +
441+This is a 'strong' line+ +
442+This is another _strong_ line+
443
444
445.Another monospaced paragraph with line breaks
446+This is a *bold* a line +
447This is a 'strong' line +
448This is another _strong_ line+
449
450endif::basebackend-docbook[]
451
452.Literal block with quotes substitution
453[subs="quotes"]
454.............................
455This is a *bold* a line
456This is a 'strong' line
457This is another _strong_ line
458.............................
459
460[verse, William Blake, from Auguries of Innocence]
461To see a world in a grain of sand,
462And a heaven in a wild flower,
463Hold infinity in the palm of your hand,
464And eternity in an hour.
465
466[quote, Bertrand Russell, The World of Mathematics (1956)]
467A good notation has subtlety and suggestiveness which at times makes
468it almost seem like a live teacher.
469
470
471URLs
472----
473Mail Addresses
474~~~~~~~~~~~~~~
475joe_bloggs@mail_server.com_
476
477joe-bloggs@mail-server.com.
478
479joe-bloggs@mail-server.com,joe-bloggs@mail-server.com,
480
481mailto:joe-bloggs@mail-server.com[Mail]
482
483mailto:joe_bloggs@mail_server.com[Mail]
484
485mailto:joe.bloggs@mail.server.com[Mail]
486
487joe.bloggs@mail.server.com +
488lorum ipsum.
489
490
491Comments
492--------
493/////////////////////////////////////////////////////////////////////
494A comment
495block.
496/////////////////////////////////////////////////////////////////////
497
498// This is a comment line.
499
500Qui in magna commodo, est labitur dolorum an. Est ne magna primis.
501// Inline comment line.
502adolescens. Sit munere ponderum dignissim et. Minim luptatum et.
503
504:showcomments:
505// This comment line will be displayed in the output.
506
507Qui in magna commodo, est labitur dolorum an. Est ne magna primis.
508// Visible inline comment line.
509adolescens. Sit munere ponderum dignissim et. Minim luptatum et.
510
511/////////////////////////////////////////////////////////////////////
512Comment blocks are never displayed in the output.
513/////////////////////////////////////////////////////////////////////
514
515:showcomments!:
516
517[[comment_macro]]
518.Block title
519// Block macro comment does not consume titles or attributes.
520Lorum ipsum.
521
522[[comment_block]]
523.Block title
524/////////////////////////////////////////////////////////////////////
525Delimited comment block does not consume titles or attributes.
526/////////////////////////////////////////////////////////////////////
527Lorum ipsum.
528
529
530ifdef::basebackend-docbook[]
531[glossary]
532List of terms
533-------------
534Using positional attribute to specify section template.
535
536[glossary]
537A glossary term::
538  The corresponding (indented) definition.
539
540A second glossary term::
541  The corresponding (indented) definition.
542
543[template="glossary"]
544List of terms
545-------------
546Using named 'template' attribute to specify section template.
547
548[glossary]
549A glossary term::
550  The corresponding (indented) definition.
551
552A second glossary term::
553  The corresponding (indented) definition.
554
555endif::basebackend-docbook[]
556
557Index Terms
558-----------
559Multi-passthough substitution (see
560http://groups.google.com/group/asciidoc/browse_frm/thread/1269dc2feb1a482c)
561((`foo`))
562(((foo,`bar`)))
563(((foo,`bar`,`two`)))
564
565Table with fractional column width units
566----------------------------------------
567NOTE: 'pagewidth' and 'pageunits' only apply to DocBook outputs.
568
569:miscellaneous.pagewidth: 17.5
570:miscellaneous.pageunits: cm
571
572.Horizontal and vertical source data
573[width="50%",cols="3,^2,^2,10",options="header"]
574|=========================================================
575|Date |Duration |Avg HR |Notes
576
577|22-Aug-08 |10:24 | 157 |
578Worked out MSHR (max sustainable heart rate) by going hard
579for this interval.
580
581|22-Aug-08 |23:03 | 152 |
582Back-to-back with previous interval.
583
584|24-Aug-08 |40:00 | 145 |
585Moderately hard interspersed with 3x 3min intervals (2min
586hard + 1min really hard taking the HR up to 160).
587
588|=========================================================
589
590== Table with parent configuration file and header attribute entry
591
592[cols="asciidoc"]
593|====
594|
595- Attribute entry from header: {test-attribute}
596- Replacement from `testcases.conf` configuration file: test-replacement
597|====
598
599== Table column specifiers with merged cells
600See
601http://groups.google.com/group/asciidoc/browse_thread/thread/c9238380a1f2507a
602
603[cols="<1m,>1,^1s, ^1e"]
604|============================================
605 .2+|        .2+|1- A     2+|2- B
606                            |i- a      |ii- b
607    |Values 1   |v1         |v2        |v3
608    |Values 2   |v4         |v5        |v6
609|============================================
610
611Floating tables and images
612--------------------------
613.Simple table
614[float="left",width="15%"]
615|=======
616|1 |2 |A
617|3 |4 |B
618|5 |6 |C
619|=======
620
621.Tiger
622[float="right"]
623image::images/tiger.png["Tiger image"]
624
625unfloat::[]
626
627Section level offsets
628---------------------
629At level 1
630
631:leveloffset: -1
632Section title
633^^^^^^^^^^^^^
634At level 2
635
636:leveloffset: 0
637Section title
638~~~~~~~~~~~~~
639At level 2
640
641:leveloffset: 2
642Section title
643-------------
644At level 3
645
646:leveloffset!:
647:numbered!:
648
649Section level offsets
650---------------------
651At level 1
652
653Single-quoted attributes
654------------------------
655[quote,'http://en.wikipedia.org/wiki/Samuel_Johnson[Samuel Johnson]']
656_____________________________________________________________________
657Sir, a woman's preaching is like a dog's walking on his hind legs. It
658is not done well; but you are surprised to find it done at all.
659_____________________________________________________________________
660
661["quote","'http://en.wikipedia.org/wiki/Samuel_Johnson[Samuel Johnson]'"]
662_____________________________________________________________________
663Sir, a woman's preaching is like a dog's walking on his hind legs. It
664is not done well; but you are surprised to find it done at all.
665_____________________________________________________________________
666
667Footnotes
668---------
669Qui in magna commodo, est labitur dolorum an. Est ne magna primis
670adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel.
671footnote:[footnote one.
672Qui in magna commodo, est labitur dolorum an. Est ne magna primis
673adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel.
674Qui in magna commodo, est labitur dolorum an. Est ne magna primis
675adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel.]
676Qui in magna commodo, est labitur dolorum an. Est ne magna primis
677adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel.
678footnoteref:["F2","footnote two.
679Qui in magna commodo, est labitur dolorum an. Est ne magna primis
680adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel."]
681Qui in magna commodo, est labitur dolorum an. Est ne magna primis
682adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel
683footnoteref:[F2].
684Qui in magna commodo, est labitur dolorum an. Est ne magna primis
685adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel.
686footnote:[http://www.methods.co.nz/asciidoc/ Qui in magna commodo,
687est labitur dolorum an. Est ne magna primis adolescens. Sit munere
688ponderum dignissim et. Minim luptatum et vel
689image:images/smallnew.png[]]
690Qui in magna commodo, est labitur dolorum an. Est ne magna primis
691adolescens. Sit munere ponderum dignissim et. Minim luptatum et vel.
692footnote:[http://www.methods.co.nz/asciidoc/]
693Qui in magna commodo, est labitur dolorum an. Est ne magna primis
694adolescens. Sit munere ponderum dignissim et. Minim luptatum et
695vel footnote:[http://www.methods.co.nz/asciidoc/[AsciiDoc website].].
696Qui in magna commodo, est labitur dolorum an. Est ne magna primis
697adolescens. Sit munere ponderum dignissim et. Minim luptatum et
698footnoteref:[F3,A footnote&#44; &#34;with an image&#34;
699image:images/smallnew.png[]].
700footnote:[With [square brackets\]] Qui in magna commodo, est labitur
701dolorum an. Est ne magna primis.
702
703
704Rulers and page breaks
705----------------------
706
707Lorum ipsum...
708
709''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
710
711Lorum ipsum...
712
713<<<
714
715Lorum ipsum...
716
717
718这是䞀䞪测试
719------------
720Double-with character titles.
721<<_这是䞀䞪测试,link to auto-generated section ID>>.
722
723
724ifdef::backend-html5[]
725HTML 5 audio and video block macros
726-----------------------------------
727audio::images/example.ogg[]
728
729.Audio tag test
730audio::images/example.ogg[]
731
732video::images/gizmo.ogv[width=200,options="nocontrols,autoplay"]
733
734.Example video
735video::images/gizmo.ogv[]
736
737video::http://www.808.dk/pics/video/gizmo.ogv[]
738
739++++
740<video poster="images/gizmo.jpg" id="video" style="cursor: pointer;" >
741  <source src="images/gizmo.webm" type="video/webm" />
742  <source src="images/gizmo.ogv" type="video/ogg" />
743  Video not playing? <a href="images/gizmo.mp4">Download file</a> instead.
744</video>
745
746<script type="text/javascript">
747  var video = document.getElementById('video');
748  video.addEventListener('click',function(){
749    video.play();
750  },false);
751</script>
752++++
753
754endif::backend-html5[]
755
756
757== Block macros
758
759:rs458: 2
760
761ifeval::[{rs458}==2]
762RS458 is 2.
763endif::[]
764ifeval::[not ({rs458}==2)]
765This will not be processed.
766endif::[]
767
768// Test eval block macro.
769eval::[Section.setlevel(1)]
770
771// Test template concatenation.
772{template:test-template}
773
774// Test ascii-ids attribute.
775:ascii-ids:
776== àn îd without accénts
777Lorum ipsum...
778
779:ascii-ids!:
780== àn îd with accénts
781Lorum ipsum...
782
783
784== Inline macros
785http://groups.google.com/group/asciidoc/[A URL with [square
786brackets\]].
Note: See TracBrowser for help on using the repository browser.