git.iko.soy/typeable/pandoc
on commonmark-github help sign in
typeable/pandoc/test/rst-reader.rst
633 lines 8.7 kB history raw
1Pandoc Test Suite
2#################
3Subtitle
4^^^^^^^^
6:Authors: John MacFarlane; Anonymous
7:Date: July 17, 2006
8:Revision: 3
10Level one header
11================
13This is a set of tests for pandoc. Most of them are adapted from
14John Gruber's markdown test suite.
16Level two header
17----------------
19Level three
20+++++++++++
22Level four with *emphasis*
23~~~~~~~~~~~~~~~~~~~~~~~~~~
25Level five
26''''''''''
28Paragraphs
29==========
31Here's a regular paragraph.
33In Markdown 1.0.0 and earlier. Version
348. This line turns into a list item.
35Because a hard-wrapped line in the
36middle of a paragraph looked like a
37list item.
39Here's one with a bullet.
40* criminey.
42Horizontal rule:
44-----
46Another:
48****
50Block Quotes
51============
53Here's a block quote:
55 This is a block quote.
56 It is pretty short.
58Here's another, differently indented:
60 This is a block quote.
61 It's indented with a tab.
63 Code in a block quote::
65 sub status {
66 print "working";
67 }
69 List in a block quote:
71 1. item one
72 2. item two
74 Nested block quotes:
76 nested
78 nested
80Code Blocks
81===========
83Code:
85::
87 ---- (should be four hyphens)
89 sub status {
90 print "working";
91 }
93::
95 this code block is indented by one tab
97And::
99 this block is indented by two tabs
101 These should not be escaped: \$ \\ \> \[ \{
103And:
105.. code-block:: python
107 def my_function(x):
108 return x + 1
110Lists
111=====
113Unordered
114---------
116Asterisks tight:
118* asterisk 1
119* asterisk 2
120* asterisk 3
122Asterisks loose:
124* asterisk 1
126* asterisk 2
128* asterisk 3
130Pluses tight:
132+ Plus 1
133+ Plus 2
134+ Plus 3
136Pluses loose:
138+ Plus 1
140+ Plus 2
142+ Plus 3
144Minuses tight:
146- Minus 1
147- Minus 2
148- Minus 3
150Minuses loose:
152- Minus 1
154- Minus 2
156- Minus 3
158Ordered
159-------
161Tight:
1631. First
1642. Second
1653. Third
167and:
1691. One
1702. Two
1713. Three
173Loose using tabs:
1751. First
1772. Second
1793. Third
181and using spaces:
1831. One
1852. Two
1873. Three
189Multiple paragraphs:
1911. Item 1, graf one.
193 Item 1. graf two. The quick brown fox jumped over the lazy dog's
194 back.
1962. Item 2.
1983. Item 3.
200Nested:
202* Tab
204 * Tab
206 * Tab
208Here's another:
2101. First
2122. Second:
214 * Fee
215 * Fie
216 * Foe
2183. Third
220Fancy list markers
221------------------
223(2) begins with 2
224(3) and now 3
226 with a continuation
228 iv. sublist with roman numerals, starting with 4
229 v. more items
231 (A) a subsublist
232 (B) a subsublist
234Nesting:
236A. Upper Alpha
238 I. Upper Roman.
240 (6) Decimal start with 6
242 c) Lower alpha with paren
244Autonumbering:
246#. Autonumber.
247#. More.
249 #. Nested.
251Autonumbering with explicit start:
253(d) item 1
254(#) item 2
256Definition
257----------
259term 1
260 Definition 1.
262term 2
263 Definition 2, paragraph 1.
265 Definition 2, paragraph 2.
267term with *emphasis*
268 Definition 3.
270Field Lists
271===========
273 :address: 61 Main St.
274 :city: *Nowhere*, MA,
275 USA
276 :phone: 123-4567
278:address: 61 Main St.
279:city: *Nowhere*, MA,
280 USA
281:phone:
282 123-4567
284HTML Blocks
285===========
287Simple block on one line:
289.. raw:: html
291 <div>foo</div>
293Now, nested:
295.. raw:: html
297 <div>
298 <div>
299 <div>
300 foo
301 </div>
302 </div>
303 </div>
305LaTeX Block
306===========
308.. raw:: latex
310 \begin{tabular}{|l|l|}\hline
311 Animal & Number \\ \hline
312 Dog & 2 \\
313 Cat & 1 \\ \hline
314 \end{tabular}
316Inline Markup
317=============
319This is *emphasized*. This is **strong**.
321This is code: ``>``, ``$``, ``\``, ``\$``, ``<html>``.
323This is\ :sub:`subscripted` and this is :sup:`superscripted`\ .
325Special Characters
326==================
328Here is some unicode:
330- I hat: Î
331- o umlaut: ö
332- section: §
333- set membership: ∈
334- copyright: ©
336AT&T has an ampersand in their name.
338This & that.
3404 < 5.
3426 > 5.
344Backslash: \\
346Backtick: \`
348Asterisk: \*
350Underscore: \_
352Left brace: \{
354Right brace: \}
356Left bracket: \[
358Right bracket: \]
360Left paren: \(
362Right paren: \)
364Greater-than: \>
366Hash: \#
368Period: \.
370Bang: \!
372Plus: \+
374Minus: \-
376Links
377=====
379Explicit: a `URL </url/>`_.
381Explicit with no label: `<foo>`_.
383Two anonymous links: `the first`__ and `the second`__
385__ /url1/
386__ /url2/
388Reference links: `link1`_ and `link2`_ and link1_ again.
390.. _link1: /url1/
391.. _`link2`: /url2/
393Another `style of reference link <link1_>`_.
395Here's a `link with an ampersand in the URL`_.
397Here's a link with an amersand in the link text: `AT&T </url/>`_.
399.. _link with an ampersand in the URL: http://example.com/?foo=1&bar=2
401Autolinks: http://example.com/?foo=1&bar=2 and nobody@nowhere.net.
403But not here::
405 http://example.com/
407Images
408======
410From "Voyage dans la Lune" by Georges Melies (1902):
412.. image:: lalune.jpg
414.. image:: lalune.jpg
415 :height: 2343
416 :alt: Voyage dans la Lune
418Here is a movie |movie| icon.
420.. |movie| image:: movie.jpg
422And an |image with a link|.
424.. |image with a link| image:: movie.jpg
425 :alt: A movie
426 :target: /url
428Comments
429========
431First paragraph
433.. comment
435..
436 Comment block, should not appear in output
437 as defined by reStructuredText
439Another paragraph
441..
442 Another comment block.
444 This one spans several
445 text elements.
447 It doesn't end until
448 indentation is restored to the
449 preceding level.
451A third paragraph
453Line blocks
454===========
456| But can a bee be said to be
457| or not to be an entire bee,
458| when half the bee is not a bee,
459| due to some ancient injury?
461| Continuation
462 line
463| and
464 another
466Simple Tables
467=============
469================== =========== ==========
470col 1 col 2 col 3
471================== =========== ==========
472r1 a b c
473r2 d e f
474================== =========== ==========
476Headless
478================== =========== ==========
479r1 a b c
480r2 d e f
481================== =========== ==========
484Grid Tables
485===========
487+------------------+-----------+------------+
488| col 1 | col 2 | col 3 |
489+==================+===========+============+
490| r1 a | b | c |
491| r1 bis | b 2 | c 2 |
492+------------------+-----------+------------+
493| r2 d | e | f |
494+------------------+-----------+------------+
496Headless
498+------------------+-----------+------------+
499| r1 a | b | c |
500| r1 bis | b 2 | c 2 |
501+------------------+-----------+------------+
502| r2 d | e | f |
503+------------------+-----------+------------+
505Spaces at ends of lines
507+------------------+-----------+------------+
508| r1 a | b | c |
509| r1 bis | b 2 | c 2 |
510+------------------+-----------+------------+
511| r2 d | e | f |
512+------------------+-----------+------------+
514Multiple blocks in a cell
516+------------------+-----------+------------+
517| r1 a | - b | c |
518| | - b 2 | c 2 |
519| r1 bis | - b 2 | c 2 |
520+------------------+-----------+------------+
522Footnotes
523=========
525[1]_
527[#]_
529[#]_
531[*]_
533.. [1] Note with one line.
535.. [#] Note with
536 continuation line.
538.. [#] Note with
540 continuation block.
542.. [*] Note with
543 continuation line
545 and a second para.
547Not in note.
549Math
550====
552Some inline math :math:`E=mc^2`\ . Now some
553display math:
555.. math:: E=mc^2
557.. math::
559 E = mc^2
561.. math::
563 E = mc^2
565 \alpha = \beta
567.. math::
568 :label: hithere
569 :nowrap:
571 E &= mc^2\\
572 F &= \pi E
574 F &= \gamma \alpha^2
576All done.
578Default-Role
579============
581Try changing the default role to a few different things.
583.. default-role:: math
585Doesn't Break Title Parsing
586---------------------------
588Inline math: `E=mc^2` or :math:`E=mc^2` or `E=mc^2`:math:.
589Other roles: :sup:`super`, `sub`:sub:.
591.. math::
592 \alpha = beta
594 E = mc^2
596.. default-role:: sup
598Some `of` these :sup:`words` are in `superscript`:sup:.
600Reset default-role to the default default.
602.. default-role::
604And now `some-invalid-string-3231231` is nonsense.
606.. role:: html(raw)
607 :format: html
609And now with :html:`<b>inline</b> <span id="test">HTML</span>`.
611.. role:: haskell(code)
612 :language: haskell
614And some inline haskell :haskell:`fmap id [1,2..10]`.
616.. role:: indirect(code)
618.. role:: py(indirect)
619 :language: python
621Indirect python role :py:`[x*x for x in [1,2,3,4,5]]`.
623.. role:: different-indirect(code)
624 :language: c
626.. role:: c(different-indirect)
628Different indirect C :c:`int x = 15;`.
630Literal symbols
631---------------
6332*2 = 4*1