git.iko.soy/typeable/pandoc
on rc/2.11.0.3 help sign in
typeable/pandoc/test/rst-reader.rst
657 lines 9.1 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
110If we use the highlight directive, we can specify a default language
111for literate blocks.
113.. highlight:: haskell
115::
117 -- this code is in haskell
118 data Tree = Leaf | Node Tree Tree
120::
122 -- this code is in haskell too
123 data Nat = Zero | Succ Nat
125.. highlight:: javascript
127::
129 -- this code is in javascript
130 let f = (x, y) => x + y
132.. highlight::
134Lists
135=====
137Unordered
138---------
140Asterisks tight:
142* asterisk 1
143* asterisk 2
144* asterisk 3
146Asterisks loose:
148* asterisk 1
150* asterisk 2
152* asterisk 3
154Pluses tight:
156+ Plus 1
157+ Plus 2
158+ Plus 3
160Pluses loose:
162+ Plus 1
164+ Plus 2
166+ Plus 3
168Minuses tight:
170- Minus 1
171- Minus 2
172- Minus 3
174Minuses loose:
176- Minus 1
178- Minus 2
180- Minus 3
182Ordered
183-------
185Tight:
1871. First
1882. Second
1893. Third
191and:
1931. One
1942. Two
1953. Three
197Loose using tabs:
1991. First
2012. Second
2033. Third
205and using spaces:
2071. One
2092. Two
2113. Three
213Multiple paragraphs:
2151. Item 1, graf one.
217 Item 1. graf two. The quick brown fox jumped over the lazy dog's
218 back.
2202. Item 2.
2223. Item 3.
224Nested:
226* Tab
228 * Tab
230 * Tab
232Here's another:
2341. First
2362. Second:
238 * Fee
239 * Fie
240 * Foe
2423. Third
244Fancy list markers
245------------------
247(2) begins with 2
248(3) and now 3
250 with a continuation
252 iv. sublist with roman numerals, starting with 4
253 v. more items
255 (A) a subsublist
256 (B) a subsublist
258Nesting:
260A. Upper Alpha
262 I. Upper Roman.
264 (6) Decimal start with 6
266 c) Lower alpha with paren
268Autonumbering:
270#. Autonumber.
271#. More.
273 #. Nested.
275Autonumbering with explicit start:
277(d) item 1
278(#) item 2
280Definition
281----------
283term 1
284 Definition 1.
286term 2
287 Definition 2, paragraph 1.
289 Definition 2, paragraph 2.
291term with *emphasis*
292 Definition 3.
294Field Lists
295===========
297 :address: 61 Main St.
298 :city: *Nowhere*, MA,
299 USA
300 :phone: 123-4567
302:address: 61 Main St.
303:city: *Nowhere*, MA,
304 USA
305:phone:
306 123-4567
308HTML Blocks
309===========
311Simple block on one line:
313.. raw:: html
315 <div>foo</div>
317Now, nested:
319.. raw:: html
321 <div>
322 <div>
323 <div>
324 foo
325 </div>
326 </div>
327 </div>
329LaTeX Block
330===========
332.. raw:: latex
334 \begin{tabular}{|l|l|}\hline
335 Animal & Number \\ \hline
336 Dog & 2 \\
337 Cat & 1 \\ \hline
338 \end{tabular}
340Inline Markup
341=============
343This is *emphasized*. This is **strong**.
345This is code: ``>``, ``$``, ``\``, ``\$``, ``<html>``.
347This is\ :sub:`subscripted` and this is :sup:`superscripted`\ .
349Special Characters
350==================
352Here is some unicode:
354- I hat: Î
355- o umlaut: ö
356- section: §
357- set membership: ∈
358- copyright: ©
360AT&T has an ampersand in their name.
362This & that.
3644 < 5.
3666 > 5.
368Backslash: \\
370Backtick: \`
372Asterisk: \*
374Underscore: \_
376Left brace: \{
378Right brace: \}
380Left bracket: \[
382Right bracket: \]
384Left paren: \(
386Right paren: \)
388Greater-than: \>
390Hash: \#
392Period: \.
394Bang: \!
396Plus: \+
398Minus: \-
400Links
401=====
403Explicit: a `URL </url/>`_.
405Explicit with no label: `<foo>`_.
407Two anonymous links: `the first`__ and `the second`__
409__ /url1/
410__ /url2/
412Reference links: `link1`_ and `link2`_ and link1_ again.
414.. _link1: /url1/
415.. _`link2`: /url2/
417Another `style of reference link <link1_>`_.
419Here's a `link with an ampersand in the URL`_.
421Here's a link with an amersand in the link text: `AT&T </url/>`_.
423.. _link with an ampersand in the URL: http://example.com/?foo=1&bar=2
425Autolinks: http://example.com/?foo=1&bar=2 and nobody@nowhere.net.
427But not here::
429 http://example.com/
431Images
432======
434From "Voyage dans la Lune" by Georges Melies (1902):
436.. image:: lalune.jpg
438.. image:: lalune.jpg
439 :height: 2343
440 :alt: Voyage dans la Lune
442Here is a movie |movie| icon.
444.. |movie| image:: movie.jpg
446And an |image with a link|.
448.. |image with a link| image:: movie.jpg
449 :alt: A movie
450 :target: /url
452Comments
453========
455First paragraph
457.. comment
459..
460 Comment block, should not appear in output
461 as defined by reStructuredText
463Another paragraph
465..
466 Another comment block.
468 This one spans several
469 text elements.
471 It doesn't end until
472 indentation is restored to the
473 preceding level.
475A third paragraph
477Line blocks
478===========
480| But can a bee be said to be
481| or not to be an entire bee,
482| when half the bee is not a bee,
483| due to some ancient injury?
485| Continuation
486 line
487| and
488 another
490Simple Tables
491=============
493================== =========== ==========
494col 1 col 2 col 3
495================== =========== ==========
496r1 a b c
497r2 d e f
498================== =========== ==========
500Headless
502================== =========== ==========
503r1 a b c
504r2 d e f
505================== =========== ==========
508Grid Tables
509===========
511+------------------+-----------+------------+
512| col 1 | col 2 | col 3 |
513+==================+===========+============+
514| r1 a | b | c |
515| r1 bis | b 2 | c 2 |
516+------------------+-----------+------------+
517| r2 d | e | f |
518+------------------+-----------+------------+
520Headless
522+------------------+-----------+------------+
523| r1 a | b | c |
524| r1 bis | b 2 | c 2 |
525+------------------+-----------+------------+
526| r2 d | e | f |
527+------------------+-----------+------------+
529Spaces at ends of lines
531+------------------+-----------+------------+
532| r1 a | b | c |
533| r1 bis | b 2 | c 2 |
534+------------------+-----------+------------+
535| r2 d | e | f |
536+------------------+-----------+------------+
538Multiple blocks in a cell
540+------------------+-----------+------------+
541| r1 a | - b | c |
542| | - b 2 | c 2 |
543| r1 bis | - b 2 | c 2 |
544+------------------+-----------+------------+
546Footnotes
547=========
549[1]_
551[#]_
553[#]_
555[*]_
557.. [1] Note with one line.
559.. [#] Note with
560 continuation line.
562.. [#] Note with
564 continuation block.
566.. [*] Note with
567 continuation line
569 and a second para.
571Not in note.
573Math
574====
576Some inline math :math:`E=mc^2`\ . Now some
577display math:
579.. math:: E=mc^2
581.. math::
583 E = mc^2
585.. math::
587 E = mc^2
589 \alpha = \beta
591.. math::
592 :label: hithere
593 :nowrap:
595 E &= mc^2\\
596 F &= \pi E
598 F &= \gamma \alpha^2
600All done.
602Default-Role
603============
605Try changing the default role to a few different things.
607.. default-role:: math
609Doesn't Break Title Parsing
610---------------------------
612Inline math: `E=mc^2` or :math:`E=mc^2` or `E=mc^2`:math:.
613Other roles: :sup:`super`, `sub`:sub:.
615.. math::
616 \alpha = beta
618 E = mc^2
620.. default-role:: sup
622Some `of` these :sup:`words` are in `superscript`:sup:.
624Reset default-role to the default default.
626.. default-role::
628And now `some-invalid-string-3231231` is nonsense.
630.. role:: html(raw)
631 :format: html
633And now with :html:`<b>inline</b> <span id="test">HTML</span>`.
635.. role:: haskell(code)
636 :language: haskell
638And some inline haskell :haskell:`fmap id [1,2..10]`.
640.. role:: indirect(code)
642.. role:: py(indirect)
643 :language: python
645Indirect python role :py:`[x*x for x in [1,2,3,4,5]]`.
647.. role:: different-indirect(code)
648 :language: c
650.. role:: c(different-indirect)
652Different indirect C :c:`int x = 15;`.
654Literal symbols
655---------------
6572*2 = 4*1