git.iko.soy/typeable/pandoc
on 1.17.0.3 help sign in
typeable/pandoc/tests/rst-reader.rst
629 lines 8.6 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/>`_.
381Two anonymous links: `the first`__ and `the second`__
383__ /url1/
384__ /url2/
386Reference links: `link1`_ and `link2`_ and link1_ again.
388.. _link1: /url1/
389.. _`link2`: /url2/
391Here's a `link with an ampersand in the URL`_.
393Here's a link with an amersand in the link text: `AT&T </url/>`_.
395.. _link with an ampersand in the URL: http://example.com/?foo=1&bar=2
397Autolinks: http://example.com/?foo=1&bar=2 and nobody@nowhere.net.
399But not here::
401 http://example.com/
403Images
404======
406From "Voyage dans la Lune" by Georges Melies (1902):
408.. image:: lalune.jpg
410.. image:: lalune.jpg
411 :height: 2343
412 :alt: Voyage dans la Lune
414Here is a movie |movie| icon.
416.. |movie| image:: movie.jpg
418And an |image with a link|.
420.. |image with a link| image:: movie.jpg
421 :alt: A movie
422 :target: /url
424Comments
425========
427First paragraph
429.. comment
431..
432 Comment block, should not appear in output
433 as defined by reStructuredText
435Another paragraph
437..
438 Another comment block.
440 This one spans several
441 text elements.
443 It doesn't end until
444 indentation is restored to the
445 preceding level.
447A third paragraph
449Line blocks
450===========
452| But can a bee be said to be
453| or not to be an entire bee,
454| when half the bee is not a bee,
455| due to some ancient injury?
457| Continuation
458 line
459| and
460 another
462Simple Tables
463=============
465================== =========== ==========
466col 1 col 2 col 3
467================== =========== ==========
468r1 a b c
469r2 d e f
470================== =========== ==========
472Headless
474================== =========== ==========
475r1 a b c
476r2 d e f
477================== =========== ==========
480Grid Tables
481===========
483+------------------+-----------+------------+
484| col 1 | col 2 | col 3 |
485+==================+===========+============+
486| r1 a | b | c |
487| r1 bis | b 2 | c 2 |
488+------------------+-----------+------------+
489| r2 d | e | f |
490+------------------+-----------+------------+
492Headless
494+------------------+-----------+------------+
495| r1 a | b | c |
496| r1 bis | b 2 | c 2 |
497+------------------+-----------+------------+
498| r2 d | e | f |
499+------------------+-----------+------------+
501Spaces at ends of lines
503+------------------+-----------+------------+
504| r1 a | b | c |
505| r1 bis | b 2 | c 2 |
506+------------------+-----------+------------+
507| r2 d | e | f |
508+------------------+-----------+------------+
510Multiple blocks in a cell
512+------------------+-----------+------------+
513| r1 a | - b | c |
514| | - b 2 | c 2 |
515| r1 bis | - b 2 | c 2 |
516+------------------+-----------+------------+
518Footnotes
519=========
521[1]_
523[#]_
525[#]_
527[*]_
529.. [1] Note with one line.
531.. [#] Note with
532 continuation line.
534.. [#] Note with
536 continuation block.
538.. [*] Note with
539 continuation line
541 and a second para.
543Not in note.
545Math
546====
548Some inline math :math:`E=mc^2`\ . Now some
549display math:
551.. math:: E=mc^2
553.. math::
555 E = mc^2
557.. math::
559 E = mc^2
561 \alpha = \beta
563.. math::
564 :label: hithere
565 :nowrap:
567 E &= mc^2\\
568 F &= \pi E
570 F &= \gamma \alpha^2
572All done.
574Default-Role
575============
577Try changing the default role to a few different things.
579.. default-role:: math
581Doesn't Break Title Parsing
582---------------------------
584Inline math: `E=mc^2` or :math:`E=mc^2` or `E=mc^2`:math:.
585Other roles: :sup:`super`, `sub`:sub:.
587.. math::
588 \alpha = beta
590 E = mc^2
592.. default-role:: sup
594Some `of` these :sup:`words` are in `superscript`:sup:.
596Reset default-role to the default default.
598.. default-role::
600And now `some-invalid-string-3231231` is nonsense.
602.. role:: html(raw)
603 :format: html
605And now with :html:`<b>inline</b> <span id="test">HTML</span>`.
607.. role:: haskell(code)
608 :language: haskell
610And some inline haskell :haskell:`fmap id [1,2..10]`.
612.. role:: indirect(code)
614.. role:: py(indirect)
615 :language: python
617Indirect python role :py:`[x*x for x in [1,2,3,4,5]]`.
619.. role:: different-indirect(code)
620 :language: c
622.. role:: c(different-indirect)
624Different indirect C :c:`int x = 15;`.
626Literal symbols
627---------------
6292*2 = 4*1