diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-12-12 20:09:14 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-12-17 13:39:17 -0800 |
commit | 543aa28c3895d4dc7d3d659b652237efb41661b0 (patch) | |
tree | f3186cc78a5235d0ead022ca0a5abed2c7a5ace0 /tests/writer.rst | |
parent | 2a075e9d7a31303efa823f1779c2b32f9fb8a14f (diff) | |
download | pandoc-543aa28c3895d4dc7d3d659b652237efb41661b0.tar.gz |
Added new prettyprinting module.
* Added Text.Pandoc.Pretty.
This is better suited for pandoc than the 'pretty' package.
One advantage is that we now get proper wrapping; Emph [Inline]
is no longer treated as a big unwrappable unit. Previously
we only got breaks for spaces at the "outer level." We can also
more easily avoid doubled blank lines. Performance is
significantly better as well.
* Removed Text.Pandoc.Blocks.
Text.Pandoc.Pretty allows you to define blocks and concatenate
them.
* Modified markdown, RST, org readers to use Text.Pandoc.Pretty
instead of Text.PrettyPrint.HughesPJ.
* Text.Pandoc.Shared: Added writerColumns to WriterOptions.
* Markdown, RST, Org writers now break text at writerColumns.
* Added --columns command-line option, which sets stColumns
and writerColumns.
* Table parsing: If the size of the header > stColumns,
use the header size as 100% for purposes of calculating
relative widths of columns.
Diffstat (limited to 'tests/writer.rst')
-rw-r--r-- | tests/writer.rst | 207 |
1 files changed, 67 insertions, 140 deletions
diff --git a/tests/writer.rst b/tests/writer.rst index dff04bc81..79d989915 100644 --- a/tests/writer.rst +++ b/tests/writer.rst @@ -9,8 +9,8 @@ Pandoc Test Suite .. role:: math(raw) :format: html latex -This is a set of tests for pandoc. Most of them are adapted from -John Gruber’s markdown test suite. +This is a set of tests for pandoc. Most of them are adapted from John Gruber’s +markdown test suite. -------------- @@ -52,9 +52,9 @@ Paragraphs Here’s a regular paragraph. -In Markdown 1.0.0 and earlier. Version 8. This line turns into a -list item. Because a hard-wrapped line in the middle of a paragraph -looked like a list item. +In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. +Because a hard-wrapped line in the middle of a paragraph looked like a list +item. Here’s one with a bullet. \* criminey. @@ -70,7 +70,6 @@ E-mail style: This is a block quote. It is pretty short. - Code in a block quote: :: @@ -81,7 +80,6 @@ E-mail style: A list: - 1. item one 2. item two @@ -89,11 +87,8 @@ E-mail style: nested - nested - - This should not be a block quote: 2 > 1. And a following paragraph. @@ -108,11 +103,11 @@ Code: :: ---- (should be four hyphens) - + sub status { print "working"; } - + this code block is indented by one tab And: @@ -120,7 +115,7 @@ And: :: this code block is indented by two tabs - + These should not be escaped: \$ \\ \> \[ \{ -------------- @@ -133,123 +128,101 @@ Unordered Asterisks tight: - - asterisk 1 - asterisk 2 - asterisk 3 Asterisks loose: - - asterisk 1 - asterisk 2 - asterisk 3 - Pluses tight: - - Plus 1 - Plus 2 - Plus 3 Pluses loose: - - Plus 1 - Plus 2 - Plus 3 - Minuses tight: - - Minus 1 - Minus 2 - Minus 3 Minuses loose: - - Minus 1 - Minus 2 - Minus 3 - Ordered ------- Tight: - 1. First 2. Second 3. Third and: - 1. One 2. Two 3. Three Loose using tabs: - 1. First 2. Second 3. Third - and using spaces: - 1. One 2. Two 3. Three - Multiple paragraphs: - 1. Item 1, graf one. - Item 1. graf two. The quick brown fox jumped over the lazy dog’s - back. + Item 1. graf two. The quick brown fox jumped over the lazy dog’s back. 2. Item 2. 3. Item 3. - Nested ------ - - Tab - - - Tab - - - Tab + - Tab + - Tab Here’s another: - 1. First 2. Second: - + - Fee - Fie - Foe @@ -258,74 +231,57 @@ Here’s another: Same thing but with paragraphs: - 1. First 2. Second: - - Fee - Fie - Foe 3. Third - Tabs and spaces --------------- - - this is a list item indented with tabs - this is a list item indented with spaces - - this is an example list item indented with tabs - this is an example list item indented with spaces - - Fancy list markers ------------------ - (2) begins with 2 (3) and now 3 with a continuation - iv. sublist with roman numerals, starting with 4 v. more items - + (A) a subsublist (B) a subsublist - - Nesting: - A. Upper Alpha - - I. Upper Roman. - - (6) Decimal start with 6 - - c) Lower alpha with paren + I. Upper Roman. + (6) Decimal start with 6 + c) Lower alpha with paren Autonumbering: - #. Autonumber. #. More. - - #. Nested. + #. Nested. Should not be a list item: @@ -367,7 +323,6 @@ orange banana yellow fruit - Multiple blocks with italics: *apple* @@ -384,8 +339,6 @@ Multiple blocks with italics: orange block quote - - Multiple definitions, tight: apple @@ -407,7 +360,6 @@ orange bank - Blank line after term, indented marker, alternate markers: apple @@ -418,36 +370,32 @@ apple orange orange fruit - 1. sublist 2. sublist - HTML Blocks =========== Simple block on one line: - .. raw:: html <div> - + foo .. raw:: html </div> - -And nested without indentation: +And nested without indentation: .. raw:: html <div> <div> <div> - + foo .. raw:: html @@ -455,30 +403,29 @@ foo </div> </div> <div> - + bar .. raw:: html </div> </div> - -Interpreted markdown in a table: +Interpreted markdown in a table: .. raw:: html <table> <tr> <td> - + This is *emphasized* .. raw:: html </td> <td> - + And this is **strong** .. raw:: html @@ -486,23 +433,22 @@ And this is **strong** </td> </tr> </table> - + <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script> - -Here’s a simple block: +Here’s a simple block: .. raw:: html <div> - + foo .. raw:: html </div> - + This should be a code block, though: :: @@ -519,14 +465,13 @@ As should this: Now, nested: - .. raw:: html <div> <div> <div> - + foo .. raw:: html @@ -534,16 +479,14 @@ foo </div> </div> </div> - -This should just be an HTML comment: +This should just be an HTML comment: .. raw:: html <!-- Comment --> - -Multiline: +Multiline: .. raw:: html @@ -551,11 +494,11 @@ Multiline: Blah Blah --> - + <!-- This is another comment. --> - + Code block: :: @@ -564,11 +507,10 @@ Code block: Just plain comment, with trailing spaces on the line: - .. raw:: html <!-- foo --> - + Code: :: @@ -577,27 +519,26 @@ Code: Hr’s: - .. raw:: html <hr> - + <hr /> - + <hr /> - + <hr> - + <hr /> - + <hr /> - + <hr class="foo" id="bar" /> - + <hr class="foo" id="bar" /> - + <hr class="foo" id="bar"> - + -------------- Inline Markup @@ -621,14 +562,12 @@ This is code: ``>``, ``$``, ``\``, ``\$``, ``<html>``. [STRIKEOUT:This is *strikeout*.] -Superscripts: a\ :sup:`bc`\ d a\ :sup:`*hello*`\ -a\ :sup:`hello there`\ . +Superscripts: a\ :sup:`bc`\ d a\ :sup:`*hello*`\ a\ :sup:`hello there`\ . -Subscripts: H\ :sub:`2`\ O, H\ :sub:`23`\ O, -H\ :sub:`many of them`\ O. +Subscripts: H\ :sub:`2`\ O, H\ :sub:`23`\ O, H\ :sub:`many of them`\ O. -These should not be superscripts or subscripts, because of the -unescaped spaces: a^b c^d, a~b c~d. +These should not be superscripts or subscripts, because of the unescaped +spaces: a^b c^d, a~b c~d. -------------- @@ -643,8 +582,8 @@ Smart quotes, ellipses, dashes ‘He said, “I want to go.”’ Were you alive in the 70’s? -Here is some quoted ‘``code``’ and a -“`quoted link <http://example.com/?foo=1&bar=2>`_”. +Here is some quoted ‘``code``’ and a “`quoted +link <http://example.com/?foo=1&bar=2>`_”. Some dashes: one—two — three—four — five. @@ -657,7 +596,6 @@ Ellipses…and…and…. LaTeX ===== - - - :math:`$2+2=4$` - :math:`$x \in y$` @@ -671,17 +609,14 @@ LaTeX These shouldn’t be math: - - To get the famous equation, write ``$e = mc^2$``. -- $22,000 is a *lot* of money. So is $34,000. (It worked if “lot” - is emphasized.) +- $22,000 is a *lot* of money. So is $34,000. (It worked if “lot” is + emphasized.) - Shoes ($20) and socks ($5). - Escaped ``$``: $73 *this should be emphasized* 23$. Here’s a LaTeX table: - - -------------- Special Characters @@ -689,7 +624,6 @@ Special Characters Here is some unicode: - - I hat: Î - o umlaut: ö - section: § @@ -796,11 +730,10 @@ Foo `biz </url/>`_. With ampersands --------------- -Here’s a -`link with an ampersand in the URL <http://example.com/?foo=1&bar=2>`_. +Here’s a `link with an ampersand in the +URL <http://example.com/?foo=1&bar=2>`_. -Here’s a link with an amersand in the link text: -`AT&T <http://att.com/>`_. +Here’s a link with an amersand in the link text: `AT&T <http://att.com/>`_. Here’s an `inline link </script?foo=1&bar=2>`_. @@ -811,7 +744,6 @@ Autolinks With an ampersand: http://example.com/?foo=1&bar=2 - - In a list? - http://example.com/ - It should. @@ -820,7 +752,6 @@ An e-mail address: nobody@nowhere.net Blockquoted: http://example.com/ - Auto-links should not occur here: ``<http://example.com/>`` :: @@ -837,9 +768,8 @@ From “Voyage dans la Lune” by Georges Melies (1902): .. figure:: lalune.jpg :align: center :alt: Voyage dans la Lune - - lalune + lalune Here is a movie |movie| icon. -------------- @@ -847,40 +777,37 @@ Here is a movie |movie| icon. Footnotes ========= -Here is a footnote reference, [1]_ and another. [2]_ This should -*not* be a footnote reference, because it contains a space.[^my -note] Here is an inline note. [3]_ +Here is a footnote reference, [1]_ and another. [2]_ This should *not* be a +footnote reference, because it contains a space.[^my note] Here is an inline +note. [3]_ Notes can go in quotes. [4]_ - - 1. And in list items. [5]_ -This paragraph should not be part of the note, as it is not -indented. +This paragraph should not be part of the note, as it is not indented. .. [1] - Here is the footnote. It can go anywhere after the footnote - reference. It need not be placed at the end of the document. + Here is the footnote. It can go anywhere after the footnote reference. It + need not be placed at the end of the document. .. [2] Here’s the long note. This one contains multiple blocks. - Subsequent blocks are indented to show that they belong to the - footnote (as with list items). + Subsequent blocks are indented to show that they belong to the footnote (as + with list items). :: { <code> } - If you want, you can indent every line, but you can also be lazy - and just indent the first line of each block. + If you want, you can indent every line, but you can also be lazy and just + indent the first line of each block. .. [3] This is *easier* to type. Inline notes may contain - `links <http://google.com>`_ and ``]`` verbatim characters, as well - as [bracketed text]. + `links <http://google.com>`_ and ``]`` verbatim characters, as well as + [bracketed text]. .. [4] In quote. |