git.iko.soy/typeable/pandoc
on master help sign in
Added plain writer.

Text.Pandoc.Writers.Markdown now exports a writePlain, which writes plain text without links, pictures, or special formatting (not even markdown conventions). git-svn-id: https://pandoc.googlecode.com/svn/trunk@1907 788f1e2b-df1e-0410-8736-df70ead52e1b

commit695961155a00738160b05c25588b6b02f681a18e authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateThu 18 Mar 2010, 06:45 (17 years ago) parent081ae41
12 files changed+904−55
README+4−4 man/man1/pandoc.1.md+4−4 pandoc.cabal+1−1 src/Text/Pandoc.hs+1 src/Text/Pandoc/Writers/Markdown.hs+67−21 src/pandoc.hs+1 templates/plain.template+23 tests/RunTests.hs+1 tests/tables.plain+79 tests/writer.markdown+22−22 tests/writer.plain+698 web/index.txt+3−3
README+4−4
@@ -5,8 +5,8 @@
55Pandoc is a [Haskell] library for converting from one markup format to
66another, and a command-line tool that uses this library. It can read
77[markdown] and (subsets of) [reStructuredText], [HTML], and [LaTeX]; and
8−it can write [markdown], [reStructuredText], [HTML], [LaTeX], [ConTeXt],
9−[RTF], [DocBook XML], [OpenDocument XML], [ODT], [GNU Texinfo],
8+it can write plain text, [markdown], [reStructuredText], [HTML], [LaTeX],
9+[ConTeXt], [RTF], [DocBook XML], [OpenDocument XML], [ODT], [GNU Texinfo],
1010[MediaWiki markup], [groff man] pages, and [S5] HTML slide shows.
1111Pandoc's enhanced version of markdown includes syntax for footnotes,
1212tables, flexible ordered lists, definition lists, delimited code blocks,
@@ -192,8 +192,8 @@ For further documentation, see the `pandoc(1)` man page.
192192: specifies the output format -- the format Pandoc will
193193 be converting *to*. *format* can be `native`, `html`, `s5`,
194194 `docbook`, `opendocument`, `latex`, `context`, `markdown`, `man`,
195− `rst`, and `rtf`. (`+lhs` can be appended to indicate that the
196− output should be treated as literate Haskell source. See
195+ `plain`, `rst`, and `rtf`. (`+lhs` can be appended to indicate that
196+ the output should be treated as literate Haskell source. See
197197 [Literate Haskell support](#literate-haskell-support), below.)
198198
199199`-s` or `--standalone`
man/man1/pandoc.1.md+4−4
@@ -14,9 +14,9 @@ pandoc [*options*] [*input-file*]...
1414
1515Pandoc converts files from one markup format to another. It can
1616read markdown and (subsets of) reStructuredText, HTML, and LaTeX, and
17−it can write markdown, reStructuredText, HTML, LaTeX, ConTeXt, Texinfo,
18−groff man, MediaWiki markup, RTF, OpenDocument XML, ODT, DocBook XML,
19−and S5 HTML slide shows.
17+it can write plain text, markdown, reStructuredText, HTML, LaTeX,
18+ConTeXt, Texinfo, groff man, MediaWiki markup, RTF, OpenDocument XML,
19+ODT, DocBook XML, and S5 HTML slide shows.
2020
2121If no *input-file* is specified, input is read from *stdin*.
2222Otherwise, the *input-files* are concatenated (with a blank
@@ -71,7 +71,7 @@ should pipe input and output through `iconv`:
7171
7272-t *FORMAT*, -w *FORMAT*, \--to=*FORMAT*, \--write=*FORMAT*
7373: Specify output format. *FORMAT* can be `native` (native Haskell),
74− `markdown` (markdown or plain text), `rst` (reStructuredText),
74+ `plain` (plain text), `markdown` (markdown), `rst` (reStructuredText),
7575 `html` (HTML), `latex` (LaTeX), `context` (ConTeXt), `man` (groff man),
7676 `mediawiki` (MediaWiki markup), `texinfo` (GNU Texinfo),
7777 `docbook` (DocBook XML), `opendocument` (OpenDocument XML),
pandoc.cabal+1−1
@@ -40,7 +40,7 @@ Data-Files:
4040 templates/opendocument.template, templates/latex.template,
4141 templates/context.template, templates/texinfo.template,
4242 templates/man.template, templates/markdown.template,
43− templates/rst.template,
43+ templates/rst.template, templates/plain.template,
4444 templates/mediawiki.template, templates/rtf.template,
4545 -- data for ODT writer
4646 reference.odt,
src/Text/Pandoc.hs+1
@@ -72,6 +72,7 @@ module Text.Pandoc
7272 , HeaderType (..)
7373 -- * Writers: converting /from/ Pandoc format
7474 , writeMarkdown
75+ , writePlain
7576 , writeRST
7677 , writeLaTeX
7778 , writeConTeXt
src/Text/Pandoc/Writers/Markdown.hs+67−21
@@ -29,7 +29,7 @@ Conversion of 'Pandoc' documents to markdown-formatted plain text.
2929
3030Markdown: <http://daringfireball.net/projects/markdown/>
3131-}
32−module Text.Pandoc.Writers.Markdown ( writeMarkdown) where
32+module Text.Pandoc.Writers.Markdown (writeMarkdown, writePlain) where
3333import Text.Pandoc.Definition
3434import Text.Pandoc.Templates (renderTemplate)
3535import Text.Pandoc.Shared
@@ -41,12 +41,43 @@ import Control.Monad.State
4141
4242type Notes = [[Block]]
4343type Refs = KeyTable
44−type WriterState = (Notes, Refs)
44+data WriterState = WriterState { stNotes :: Notes
45+ , stRefs :: Refs
46+ , stPlain :: Bool }
4547
4648-- | Convert Pandoc to Markdown.
4749writeMarkdown :: WriterOptions -> Pandoc -> String
4850writeMarkdown opts document =
49− evalState (pandocToMarkdown opts document) ([],[])
51+ evalState (pandocToMarkdown opts document) WriterState{ stNotes = []
52+ , stRefs = []
53+ , stPlain = False }
54+
55+-- | Convert Pandoc to plain text (like markdown, but without links,
56+-- pictures, or inline formatting).
57+writePlain :: WriterOptions -> Pandoc -> String
58+writePlain opts document =
59+ evalState (pandocToMarkdown opts document') WriterState{ stNotes = []
60+ , stRefs = []
61+ , stPlain = True }
62+ where document' = plainify document
63+
64+plainify :: Pandoc -> Pandoc
65+plainify = processWith go
66+ where go :: [Inline] -> [Inline]
67+ go (Emph xs : ys) = go xs ++ go ys
68+ go (Strong xs : ys) = go xs ++ go ys
69+ go (Strikeout xs : ys) = go xs ++ go ys
70+ go (Superscript xs : ys) = go xs ++ go ys
71+ go (Subscript xs : ys) = go xs ++ go ys
72+ go (SmallCaps xs : ys) = go xs ++ go ys
73+ go (Code s : ys) = Str s : go ys
74+ go (Math _ s : ys) = Str s : go ys
75+ go (TeX _ : ys) = Str "" : go ys
76+ go (HtmlInline _ : ys) = Str "" : go ys
77+ go (Link xs _ : ys) = go xs ++ go ys
78+ go (Image _ _ : ys) = go ys
79+ go (x : ys) = x : go ys
80+ go [] = []
5081
5182-- | Return markdown representation of document.
5283pandocToMarkdown :: WriterOptions -> Pandoc -> State WriterState String
@@ -60,10 +91,10 @@ pandocToMarkdown opts (Pandoc (Meta title authors date) blocks) = do
6091 then tableOfContents opts headerBlocks
6192 else empty
6293 body <- blockListToMarkdown opts blocks
63− (notes, _) <- get
64− notes' <- notesToMarkdown opts (reverse notes)
65− (_, refs) <- get -- note that the notes may contain refs
66− refs' <- keyTableToMarkdown opts (reverse refs)
94+ st <- get
95+ notes' <- notesToMarkdown opts (reverse $ stNotes st)
96+ st' <- get -- note that the notes may contain refs
97+ refs' <- keyTableToMarkdown opts (reverse $ stRefs st')
6798 let main = render $ body $+$ text "" $+$ notes' $+$ text "" $+$ refs'
6899 let context = writerVariables opts ++
69100 [ ("toc", render toc)
@@ -114,7 +145,9 @@ tableOfContents :: WriterOptions -> [Block] -> Doc
114145tableOfContents opts headers =
115146 let opts' = opts { writerIgnoreNotes = True }
116147 contents = BulletList $ map elementToListItem $ hierarchicalize headers
117− in evalState (blockToMarkdown opts' contents) ([],[])
148+ in evalState (blockToMarkdown opts' contents) WriterState{ stNotes = []
149+ , stRefs = []
150+ , stPlain = False }
118151
119152-- | Converts an Element to a list item for a table of contents,
120153elementToListItem :: Element -> [Block]
@@ -164,13 +197,18 @@ blockToMarkdown opts (Para inlines) = do
164197 then char '\\'
165198 else empty
166199 return $ esc <> contents <> text "\n"
167−blockToMarkdown _ (RawHtml str) = return $ text str
200+blockToMarkdown _ (RawHtml str) = do
201+ st <- get
202+ if stPlain st
203+ then return empty
204+ else return $ text str
168205blockToMarkdown _ HorizontalRule = return $ text "\n* * * * *\n"
169206blockToMarkdown opts (Header level inlines) = do
170207 contents <- inlineListToMarkdown opts inlines
208+ st <- get
171209 -- use setext style headers if in literate haskell mode.
172210 -- ghc interprets '#' characters in column 1 as line number specifiers.
173− if writerLiterateHaskell opts
211+ if writerLiterateHaskell opts || stPlain st
174212 then let len = length $ render contents
175213 in return $ contents <> text "\n" <>
176214 case level of
@@ -185,11 +223,14 @@ blockToMarkdown opts (CodeBlock (_,classes,_) str) | "haskell" `elem` classes &&
185223blockToMarkdown opts (CodeBlock _ str) = return $
186224 (nest (writerTabStop opts) $ vcat $ map text (lines str)) <> text "\n"
187225blockToMarkdown opts (BlockQuote blocks) = do
226+ st <- get
188227 -- if we're writing literate haskell, put a space before the bird tracks
189228 -- so they won't be interpreted as lhs...
190229 let leader = if writerLiterateHaskell opts
191230 then text . (" > " ++)
192− else text . ("> " ++)
231+ else if stPlain st
232+ then text . (" " ++)
233+ else text . ("> " ++)
193234 contents <- blockListToMarkdown opts blocks
194235 return $ (vcat $ map leader $ lines $ render contents) <>
195236 text "\n"
@@ -273,7 +314,8 @@ definitionListItemToMarkdown :: WriterOptions
273314definitionListItemToMarkdown opts (label, defs) = do
274315 labelText <- inlineListToMarkdown opts label
275316 let tabStop = writerTabStop opts
276− let leader = char ':'
317+ st <- get
318+ let leader = if stPlain st then empty else text " ~"
277319 contents <- liftM vcat $
278320 mapM (liftM ((leader $$) . nest tabStop . vcat) . mapM (blockToMarkdown opts)) defs
279321 return $ labelText $+$ contents
@@ -289,18 +331,18 @@ blockListToMarkdown opts blocks =
289331-- Prefer label if possible; otherwise, generate a unique key.
290332getReference :: [Inline] -> Target -> State WriterState [Inline]
291333getReference label (src, tit) = do
292− (_,refs) <- get
293− case find ((== (src, tit)) . snd) refs of
334+ st <- get
335+ case find ((== (src, tit)) . snd) (stRefs st) of
294336 Just (ref, _) -> return ref
295337 Nothing -> do
296− let label' = case find ((== label) . fst) refs of
338+ let label' = case find ((== label) . fst) (stRefs st) of
297339 Just _ -> -- label is used; generate numerical label
298340 case find (\n -> not (any (== [Str (show n)])
299− (map fst refs))) [1..(10000 :: Integer)] of
341+ (map fst (stRefs st)))) [1..(10000 :: Integer)] of
300342 Just x -> [Str (show x)]
301343 Nothing -> error "no unique label"
302344 Nothing -> label
303− modify (\(notes, refs') -> (notes, (label', (src,tit)):refs'))
345+ modify (\s -> s{ stRefs = (label', (src,tit)) : stRefs st })
304346 return label'
305347
306348-- | Convert list of Pandoc inline elements to markdown.
@@ -346,7 +388,11 @@ inlineToMarkdown _ (Code str) =
346388 marker = replicate (longest + 1) '`'
347389 spacer = if (longest == 0) then "" else " " in
348390 return $ text (marker ++ spacer ++ str ++ spacer ++ marker)
349−inlineToMarkdown _ (Str str) = return $ text $ escapeString str
391+inlineToMarkdown _ (Str str) = do
392+ st <- get
393+ if stPlain st
394+ then return $ text str
395+ else return $ text $ escapeString str
350396inlineToMarkdown _ (Math InlineMath str) = return $ char '$' <> text str <> char '$'
351397inlineToMarkdown _ (Math DisplayMath str) = return $ text "$$" <> text str <> text "$$"
352398inlineToMarkdown _ (TeX str) = return $ text str
@@ -380,7 +426,7 @@ inlineToMarkdown opts (Image alternate (source, tit)) = do
380426 linkPart <- inlineToMarkdown opts (Link txt (source, tit))
381427 return $ char '!' <> linkPart
382428inlineToMarkdown _ (Note contents) = do
383− modify (\(notes, refs) -> (contents:notes, refs)) -- add to notes in state
384− (notes, _) <- get
385− let ref = show $ (length notes)
429+ modify (\st -> st{ stNotes = contents : stNotes st })
430+ st <- get
431+ let ref = show $ (length $ stNotes st)
386432 return $ text "[^" <> text ref <> char ']'
src/pandoc.hs+1
@@ -123,6 +123,7 @@ writers = [("native" , writeDoc)
123123 ,("man" , writeMan)
124124 ,("markdown" , writeMarkdown)
125125 ,("markdown+lhs" , writeMarkdown)
126+ ,("plain" , writePlain)
126127 ,("rst" , writeRST)
127128 ,("rst+lhs" , writeRST)
128129 ,("mediawiki" , writeMediaWiki)
templates/plain.templatenew file+23
@@ -0,0 +1,23 @@
1+$if(titleblock)$
2+$title$
3+$for(author)$$author$$sep$; $endfor$
4+$date$
5+
6+$endif$
7+$for(header-includes)$
8+$header-includes$
9+
10+$endfor$
11+$for(include-before)$
12+$include-before$
13+
14+$endfor$
15+$if(toc)$
16+$toc$
17+
18+$endif$
19+$body$
20+$for(include-after)$
21+
22+$include-after$
23+$endfor$
tests/RunTests.hs+1
@@ -52,6 +52,7 @@ writerFormats = [ "native"
5252 , "context"
5353 , "texinfo"
5454 , "man"
55+ , "plain"
5556 , "markdown"
5657 , "rst"
5758 , "mediawiki"
tests/tables.plainnew file+79
@@ -0,0 +1,79 @@
1+Simple table with caption:
2+
3+ Right Left Center Default
4+ ------- ------ -------- ---------
5+ 12 12 12 12
6+ 123 123 123 123
7+ 1 1 1 1
8+
9+ Table: Demonstration of simple table syntax.
10+
11+Simple table without caption:
12+
13+ Right Left Center Default
14+ ------- ------ -------- ---------
15+ 12 12 12 12
16+ 123 123 123 123
17+ 1 1 1 1
18+
19+Simple table indented two spaces:
20+
21+ Right Left Center Default
22+ ------- ------ -------- ---------
23+ 12 12 12 12
24+ 123 123 123 123
25+ 1 1 1 1
26+
27+ Table: Demonstration of simple table syntax.
28+
29+Multiline table with caption:
30+
31+ --------------------------------------------------------------
32+ Centered Left Right Default aligned
33+ Header Aligned Aligned
34+ ----------- ---------- ------------ --------------------------
35+ First row 12.0 Example of a row that
36+ spans multiple lines.
37+
38+ Second row 5.0 Here's another one. Note
39+ the blank line between
40+ rows.
41+ --------------------------------------------------------------
42+
43+ Table: Here's the caption. It may span multiple lines.
44+
45+Multiline table without caption:
46+
47+ --------------------------------------------------------------
48+ Centered Left Right Default aligned
49+ Header Aligned Aligned
50+ ----------- ---------- ------------ --------------------------
51+ First row 12.0 Example of a row that
52+ spans multiple lines.
53+
54+ Second row 5.0 Here's another one. Note
55+ the blank line between
56+ rows.
57+ --------------------------------------------------------------
58+
59+Table without column headers:
60+
61+ ----- ----- ----- -----
62+ 12 12 12 12
63+ 123 123 123 123
64+ 1 1 1 1
65+ ----- ----- ----- -----
66+
67+Multiline table without column headers:
68+
69+ ----------- ---------- ------------ --------------------------
70+ First row 12.0 Example of a row that
71+ spans multiple lines.
72+
73+ Second row 5.0 Here's another one. Note
74+ the blank line between
75+ rows.
76+ ----------- ---------- ------------ --------------------------
77+
78+
79+
tests/writer.markdown+22−22
@@ -281,42 +281,42 @@ B. Williams
281281Tight using spaces:
282282
283283apple
284−: red fruit
284+ ~ red fruit
285285orange
286−: orange fruit
286+ ~ orange fruit
287287banana
288−: yellow fruit
288+ ~ yellow fruit
289289
290290Tight using tabs:
291291
292292apple
293−: red fruit
293+ ~ red fruit
294294orange
295−: orange fruit
295+ ~ orange fruit
296296banana
297−: yellow fruit
297+ ~ yellow fruit
298298
299299Loose:
300300
301301apple
302−: red fruit
302+ ~ red fruit
303303
304304orange
305−: orange fruit
305+ ~ orange fruit
306306
307307banana
308−: yellow fruit
308+ ~ yellow fruit
309309
310310
311311Multiple blocks with italics:
312312
313313*apple*
314−: red fruit
314+ ~ red fruit
315315
316316 contains seeds, crisp, pleasant to taste
317317
318318*orange*
319−: orange fruit
319+ ~ orange fruit
320320
321321 { orange code block }
322322
@@ -326,34 +326,34 @@ Multiple blocks with italics:
326326Multiple definitions, tight:
327327
328328apple
329−: red fruit
330−: computer
329+ ~ red fruit
330+ ~ computer
331331orange
332−: orange fruit
333−: bank
332+ ~ orange fruit
333+ ~ bank
334334
335335Multiple definitions, loose:
336336
337337apple
338−: red fruit
338+ ~ red fruit
339339
340−: computer
340+ ~ computer
341341
342342orange
343−: orange fruit
343+ ~ orange fruit
344344
345−: bank
345+ ~ bank
346346
347347
348348Blank line after term, indented marker, alternate markers:
349349
350350apple
351−: red fruit
351+ ~ red fruit
352352
353−: computer
353+ ~ computer
354354
355355orange
356−: orange fruit
356+ ~ orange fruit
357357
358358 1. sublist
359359 2. sublist
tests/writer.plainnew file+698
@@ -0,0 +1,698 @@
1+Pandoc Test Suite
2+John MacFarlane; Anonymous
3+July 17, 2006
4+
5+This is a set of tests for pandoc. Most of them are adapted from
6+John Gruber's markdown test suite.
7+
8+
9+* * * * *
10+
11+Headers
12+=======
13+
14+Level 2 with an embedded link
15+-----------------------------
16+
17+Level 3 with emphasis
18+
19+Level 4
20+
21+Level 5
22+
23+Level 1
24+=======
25+
26+Level 2 with emphasis
27+---------------------
28+
29+Level 3
30+
31+with no blank line
32+
33+Level 2
34+-------
35+
36+with no blank line
37+
38+
39+* * * * *
40+
41+Paragraphs
42+==========
43+
44+Here's a regular paragraph.
45+
46+In Markdown 1.0.0 and earlier. Version 8. This line turns into a
47+list item. Because a hard-wrapped line in the middle of a paragraph
48+looked like a list item.
49+
50+Here's one with a bullet. * criminey.
51+
52+There should be a hard line break
53+here.
54+
55+
56+* * * * *
57+
58+Block Quotes
59+============
60+
61+E-mail style:
62+
63+ This is a block quote. It is pretty short.
64+
65+ Code in a block quote:
66+
67+ sub status {
68+ print "working";
69+ }
70+
71+ A list:
72+
73+ 1. item one
74+ 2. item two
75+
76+ Nested block quotes:
77+
78+ nested
79+
80+ nested
81+
82+This should not be a block quote: 2 > 1.
83+
84+And a following paragraph.
85+
86+
87+* * * * *
88+
89+Code Blocks
90+===========
91+
92+Code:
93+
94+ ---- (should be four hyphens)
95+
96+ sub status {
97+ print "working";
98+ }
99+
100+ this code block is indented by one tab
101+
102+And:
103+
104+ this code block is indented by two tabs
105+
106+ These should not be escaped: \$ \\ \> \[ \{
107+
108+
109+* * * * *
110+
111+Lists
112+=====
113+
114+Unordered
115+---------
116+
117+Asterisks tight:
118+
119+- asterisk 1
120+- asterisk 2
121+- asterisk 3
122+
123+Asterisks loose:
124+
125+- asterisk 1
126+
127+- asterisk 2
128+
129+- asterisk 3
130+
131+
132+Pluses tight:
133+
134+- Plus 1
135+- Plus 2
136+- Plus 3
137+
138+Pluses loose:
139+
140+- Plus 1
141+
142+- Plus 2
143+
144+- Plus 3
145+
146+
147+Minuses tight:
148+
149+- Minus 1
150+- Minus 2
151+- Minus 3
152+
153+Minuses loose:
154+
155+- Minus 1
156+
157+- Minus 2
158+
159+- Minus 3
160+
161+
162+Ordered
163+-------
164+
165+Tight:
166+
167+1. First
168+2. Second
169+3. Third
170+
171+and:
172+
173+1. One
174+2. Two
175+3. Three
176+
177+Loose using tabs:
178+
179+1. First
180+
181+2. Second
182+
183+3. Third
184+
185+
186+and using spaces:
187+
188+1. One
189+
190+2. Two
191+
192+3. Three
193+
194+
195+Multiple paragraphs:
196+
197+1. Item 1, graf one.
198+
199+ Item 1. graf two. The quick brown fox jumped over the lazy dog's
200+ back.
201+
202+2. Item 2.
203+
204+3. Item 3.
205+
206+
207+Nested
208+------
209+
210+- Tab
211+ - Tab
212+ - Tab
213+
214+
215+
216+Here's another:
217+
218+1. First
219+2. Second:
220+ - Fee
221+ - Fie
222+ - Foe
223+
224+3. Third
225+
226+Same thing but with paragraphs:
227+
228+1. First
229+
230+2. Second:
231+
232+ - Fee
233+ - Fie
234+ - Foe
235+
236+3. Third
237+
238+
239+Tabs and spaces
240+---------------
241+
242+- this is a list item indented with tabs
243+
244+- this is a list item indented with spaces
245+
246+ - this is an example list item indented with tabs
247+
248+ - this is an example list item indented with spaces
249+
250+
251+
252+Fancy list markers
253+------------------
254+
255+(2) begins with 2
256+(3) and now 3
257+
258+ with a continuation
259+
260+ iv. sublist with roman numerals, starting with 4
261+ v. more items
262+ (A) a subsublist
263+ (B) a subsublist
264+
265+
266+
267+Nesting:
268+
269+A. Upper Alpha
270+ I. Upper Roman.
271+ (6) Decimal start with 6
272+ c) Lower alpha with paren
273+
274+
275+
276+
277+Autonumbering:
278+
279+1. Autonumber.
280+2. More.
281+ 1. Nested.
282+
283+
284+Should not be a list item:
285+
286+M.A. 2007
287+
288+B. Williams
289+
290+
291+* * * * *
292+
293+Definition Lists
294+================
295+
296+Tight using spaces:
297+
298+apple
299+ red fruit
300+orange
301+ orange fruit
302+banana
303+ yellow fruit
304+
305+Tight using tabs:
306+
307+apple
308+ red fruit
309+orange
310+ orange fruit
311+banana
312+ yellow fruit
313+
314+Loose:
315+
316+apple
317+ red fruit
318+
319+orange
320+ orange fruit
321+
322+banana
323+ yellow fruit
324+
325+
326+Multiple blocks with italics:
327+
328+apple
329+ red fruit
330+
331+ contains seeds, crisp, pleasant to taste
332+
333+orange
334+ orange fruit
335+
336+ { orange code block }
337+
338+ orange block quote
339+
340+
341+Multiple definitions, tight:
342+
343+apple
344+ red fruit
345+ computer
346+orange
347+ orange fruit
348+ bank
349+
350+Multiple definitions, loose:
351+
352+apple
353+ red fruit
354+
355+ computer
356+
357+orange
358+ orange fruit
359+
360+ bank
361+
362+
363+Blank line after term, indented marker, alternate markers:
364+
365+apple
366+ red fruit
367+
368+ computer
369+
370+orange
371+ orange fruit
372+
373+ 1. sublist
374+ 2. sublist
375+
376+
377+HTML Blocks
378+===========
379+
380+Simple block on one line:
381+
382+foo
383+And nested without indentation:
384+
385+foo
386+bar
387+Interpreted markdown in a table:
388+
389+This is emphasized
390+And this is strong
391+Here's a simple block:
392+
393+foo
394+This should be a code block, though:
395+
396+ <div>
397+ foo
398+ </div>
399+
400+As should this:
401+
402+ <div>foo</div>
403+
404+Now, nested:
405+
406+foo
407+This should just be an HTML comment:
408+
409+Multiline:
410+
411+Code block:
412+
413+ <!-- Comment -->
414+
415+Just plain comment, with trailing spaces on the line:
416+
417+Code:
418+
419+ <hr />
420+
421+Hr's:
422+
423+
424+* * * * *
425+
426+Inline Markup
427+=============
428+
429+This is emphasized, and so is this.
430+
431+This is strong, and so is this.
432+
433+An emphasized link.
434+
435+This is strong and em.
436+
437+So is this word.
438+
439+This is strong and em.
440+
441+So is this word.
442+
443+This is code: >, $, \, \$, <html>.
444+
445+This is strikeout.
446+
447+Superscripts: abcd ahello ahello there.
448+
449+Subscripts: H2O, H23O, Hmany of themO.
450+
451+These should not be superscripts or subscripts, because of the
452+unescaped spaces: a^b c^d, a~b c~d.
453+
454+
455+* * * * *
456+
457+Smart quotes, ellipses, dashes
458+==============================
459+
460+"Hello," said the spider. "'Shelob' is my name."
461+
462+'A', 'B', and 'C' are letters.
463+
464+'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
465+
466+'He said, "I want to go."' Were you alive in the 70's?
467+
468+Here is some quoted 'code' and a "quoted link".
469+
470+Some dashes: one--two -- three--four -- five.
471+
472+Dashes between numbers: 5-7, 255-66, 1987-1999.
473+
474+Ellipses...and...and....
475+
476+
477+* * * * *
478+
479+LaTeX
480+=====
481+
482+-
483+- 2+2=4
484+- x \in y
485+- \alpha \wedge \omega
486+- 223
487+- p-Tree
488+- Here's some display math:
489+ \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}
490+- Here's one that has a line break in it:
491+ \alpha + \omega \times x^2.
492+
493+These shouldn't be math:
494+
495+- To get the famous equation, write $e = mc^2$.
496+- $22,000 is a lot of money. So is $34,000. (It worked if "lot"
497+ is emphasized.)
498+- Shoes ($20) and socks ($5).
499+- Escaped $: $73 this should be emphasized 23$.
500+
501+Here's a LaTeX table:
502+
503+
504+
505+
506+* * * * *
507+
508+Special Characters
509+==================
510+
511+Here is some unicode:
512+
513+- I hat: Î
514+- o umlaut: ö
515+- section: §
516+- set membership: ∈
517+- copyright: ©
518+
519+AT&T has an ampersand in their name.
520+
521+AT&T is another way to write it.
522+
523+This & that.
524+
525+4 < 5.
526+
527+6 > 5.
528+
529+Backslash: \
530+
531+Backtick: `
532+
533+Asterisk: *
534+
535+Underscore: _
536+
537+Left brace: {
538+
539+Right brace: }
540+
541+Left bracket: [
542+
543+Right bracket: ]
544+
545+Left paren: (
546+
547+Right paren: )
548+
549+Greater-than: >
550+
551+Hash: #
552+
553+Period: .
554+
555+Bang: !
556+
557+Plus: +
558+
559+Minus: -
560+
561+
562+* * * * *
563+
564+Links
565+=====
566+
567+Explicit
568+--------
569+
570+Just a URL.
571+
572+URL and title.
573+
574+URL and title.
575+
576+URL and title.
577+
578+URL and title
579+
580+URL and title
581+
582+with_underscore
583+
584+Email link
585+
586+Empty.
587+
588+Reference
589+---------
590+
591+Foo bar.
592+
593+Foo bar.
594+
595+Foo bar.
596+
597+With embedded [brackets].
598+
599+b by itself should be a link.
600+
601+Indented once.
602+
603+Indented twice.
604+
605+Indented thrice.
606+
607+This should [not][] be a link.
608+
609+ [not]: /url
610+
611+Foo bar.
612+
613+Foo biz.
614+
615+With ampersands
616+---------------
617+
618+Here's a link with an ampersand in the URL.
619+
620+Here's a link with an amersand in the link text: AT&T.
621+
622+Here's an inline link.
623+
624+Here's an inline link in pointy braces.
625+
626+Autolinks
627+---------
628+
629+With an ampersand: http://example.com/?foo=1&bar=2
630+
631+- In a list?
632+- http://example.com/
633+- It should.
634+
635+An e-mail address: nobody@nowhere.net
636+
637+ Blockquoted: http://example.com/
638+
639+Auto-links should not occur here: <http://example.com/>
640+
641+ or here: <http://example.com/>
642+
643+
644+* * * * *
645+
646+Images
647+======
648+
649+From "Voyage dans la Lune" by Georges Melies (1902):
650+
651+
652+
653+Here is a movie icon.
654+
655+
656+* * * * *
657+
658+Footnotes
659+=========
660+
661+Here is a footnote reference,[^1] and another.[^2] This should not
662+be a footnote reference, because it contains a space.[^my note]
663+Here is an inline note.[^3]
664+
665+ Notes can go in quotes.[^4]
666+
667+1. And in list items.[^5]
668+
669+This paragraph should not be part of the note, as it is not
670+indented.
671+
672+
673+[^1]:
674+ Here is the footnote. It can go anywhere after the footnote
675+ reference. It need not be placed at the end of the document.
676+
677+[^2]:
678+ Here's the long note. This one contains multiple blocks.
679+
680+ Subsequent blocks are indented to show that they belong to the
681+ footnote (as with list items).
682+
683+ { <code> }
684+
685+ If you want, you can indent every line, but you can also be lazy
686+ and just indent the first line of each block.
687+
688+[^3]:
689+ This is easier to type. Inline notes may contain links and ]
690+ verbatim characters, as well as [bracketed text].
691+
692+[^4]:
693+ In quote.
694+
695+[^5]:
696+ In list.
697+
698+
web/index.txt+3−3
@@ -5,9 +5,9 @@
55Pandoc is a [Haskell] library for converting from one markup format
66to another, and a command-line tool that uses this library. It can read
77[markdown] and (subsets of) [reStructuredText], [HTML], and [LaTeX],
8−and it can write [markdown], [reStructuredText], [HTML], [LaTeX], [ConTeXt],
9−[PDF], [RTF], [DocBook XML], [OpenDocument XML], [ODT], [GNU Texinfo],
10−[MediaWiki markup], [groff man] pages, and [S5] HTML slide shows.
8+and it can write plain text, [markdown], [reStructuredText], [HTML], [LaTeX],
9+[ConTeXt], [PDF], [RTF], [DocBook XML], [OpenDocument XML], [ODT],
10+[GNU Texinfo], [MediaWiki markup], [groff man] pages, and [S5] HTML slide shows.
1111
1212Pandoc features
1313