git.iko.soy/typeable/pandoc
on 4eff607 help sign in
typeable/pandoc/tests/rst-reader.rst
631 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/
393Here's a `link with an ampersand in the URL`_.
395Here's a link with an amersand in the link text: `AT&T </url/>`_.
397.. _link with an ampersand in the URL: http://example.com/?foo=1&bar=2
399Autolinks: http://example.com/?foo=1&bar=2 and nobody@nowhere.net.
401But not here::
403 http://example.com/
405Images
406======
408From "Voyage dans la Lune" by Georges Melies (1902):
410.. image:: lalune.jpg
412.. image:: lalune.jpg
413 :height: 2343
414 :alt: Voyage dans la Lune
416Here is a movie |movie| icon.
418.. |movie| image:: movie.jpg
420And an |image with a link|.
422.. |image with a link| image:: movie.jpg
423 :alt: A movie
424 :target: /url
426Comments
427========
429First paragraph
431.. comment
433..
434 Comment block, should not appear in output
435 as defined by reStructuredText
437Another paragraph
439..
440 Another comment block.
442 This one spans several
443 text elements.
445 It doesn't end until
446 indentation is restored to the
447 preceding level.
449A third paragraph
451Line blocks
452===========
454| But can a bee be said to be
455| or not to be an entire bee,
456| when half the bee is not a bee,
457| due to some ancient injury?
459| Continuation
460 line
461| and
462 another
464Simple Tables
465=============
467================== =========== ==========
468col 1 col 2 col 3
469================== =========== ==========
470r1 a b c
471r2 d e f
472================== =========== ==========
474Headless
476================== =========== ==========
477r1 a b c
478r2 d e f
479================== =========== ==========
482Grid Tables
483===========
485+------------------+-----------+------------+
486| col 1 | col 2 | col 3 |
487+==================+===========+============+
488| r1 a | b | c |
489| r1 bis | b 2 | c 2 |
490+------------------+-----------+------------+
491| r2 d | e | f |
492+------------------+-----------+------------+
494Headless
496+------------------+-----------+------------+
497| r1 a | b | c |
498| r1 bis | b 2 | c 2 |
499+------------------+-----------+------------+
500| r2 d | e | f |
501+------------------+-----------+------------+
503Spaces at ends of lines
505+------------------+-----------+------------+
506| r1 a | b | c |
507| r1 bis | b 2 | c 2 |
508+------------------+-----------+------------+
509| r2 d | e | f |
510+------------------+-----------+------------+
512Multiple blocks in a cell
514+------------------+-----------+------------+
515| r1 a | - b | c |
516| | - b 2 | c 2 |
517| r1 bis | - b 2 | c 2 |
518+------------------+-----------+------------+
520Footnotes
521=========
523[1]_
525[#]_
527[#]_
529[*]_
531.. [1] Note with one line.
533.. [#] Note with
534 continuation line.
536.. [#] Note with
538 continuation block.
540.. [*] Note with
541 continuation line
543 and a second para.
545Not in note.
547Math
548====
550Some inline math :math:`E=mc^2`\ . Now some
551display math:
553.. math:: E=mc^2
555.. math::
557 E = mc^2
559.. math::
561 E = mc^2
563 \alpha = \beta
565.. math::
566 :label: hithere
567 :nowrap:
569 E &= mc^2\\
570 F &= \pi E
572 F &= \gamma \alpha^2
574All done.
576Default-Role
577============
579Try changing the default role to a few different things.
581.. default-role:: math
583Doesn't Break Title Parsing
584---------------------------
586Inline math: `E=mc^2` or :math:`E=mc^2` or `E=mc^2`:math:.
587Other roles: :sup:`super`, `sub`:sub:.
589.. math::
590 \alpha = beta
592 E = mc^2
594.. default-role:: sup
596Some `of` these :sup:`words` are in `superscript`:sup:.
598Reset default-role to the default default.
600.. default-role::
602And now `some-invalid-string-3231231` is nonsense.
604.. role:: html(raw)
605 :format: html
607And now with :html:`<b>inline</b> <span id="test">HTML</span>`.
609.. role:: haskell(code)
610 :language: haskell
612And some inline haskell :haskell:`fmap id [1,2..10]`.
614.. role:: indirect(code)
616.. role:: py(indirect)
617 :language: python
619Indirect python role :py:`[x*x for x in [1,2,3,4,5]]`.
621.. role:: different-indirect(code)
622 :language: c
624.. role:: c(different-indirect)
626Different indirect C :c:`int x = 15;`.
628Literal symbols
629---------------
6312*2 = 4*1