From 74d53f4347623631c17be557d3682dd807214263 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 17 Mar 2013 17:43:51 -0700 Subject: Added Text.Pandoc.Readers.OPML, exporting readOPML. The _note attribute is supported. This is unofficial, but used e.g. in OmniOutliner and supported by multimarkdown. We treat the contents as markdown blocks under a section header. Added to documentation and tests. --- tests/Tests/Old.hs | 4 +++ tests/opml-reader.native | 66 +++++++++++++++++++++++++++++++++++ tests/opml-reader.opml | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+) create mode 100644 tests/opml-reader.native create mode 100644 tests/opml-reader.opml (limited to 'tests') diff --git a/tests/Tests/Old.hs b/tests/Tests/Old.hs index 9e7493504..c22fa9830 100644 --- a/tests/Tests/Old.hs +++ b/tests/Tests/Old.hs @@ -124,6 +124,10 @@ tests = [ testGroup "markdown" , test "reader" ["-r", "mediawiki", "-w", "native", "-s"] "mediawiki-reader.wiki" "mediawiki-reader.native" ] + , testGroup "opml" + [ test "reader" ["-r", "opml", "-w", "native", "-s"] + "opml-reader.opml" "opml-reader.native" + ] , testGroup "other writers" $ map (\f -> testGroup f $ writerTests f) [ "opendocument" , "context" , "texinfo" , "man" , "plain" , "rtf", "org", "asciidoc" diff --git a/tests/opml-reader.native b/tests/opml-reader.native new file mode 100644 index 000000000..8a627c025 --- /dev/null +++ b/tests/opml-reader.native @@ -0,0 +1,66 @@ +Pandoc (Meta {docTitle = [Str "states.opml"], docAuthors = [[Str "Dave",Space,Str "Winer"]], docDate = [Str "Thu,",Space,Str "14",Space,Str "Jul",Space,Str "2005",Space,Str "23:41:05",Space,Str "GMT"]}) +[Header 1 ("",[],[]) [Str "United",Space,Str "States"] +,Header 2 ("",[],[]) [Str "Far",Space,Str "West"] +,Header 3 ("",[],[]) [Str "Alaska"] +,Header 3 ("",[],[]) [Str "California"] +,Header 3 ("",[],[]) [Str "Hawaii"] +,Header 3 ("",[],[]) [Strong [Str "Nevada"]] +,Para [Str "I",Space,Str "lived",Space,Str "here",Space,Emph [Str "once"],Str "."] +,Para [Str "Loved",Space,Str "it."] +,Header 4 ("",[],[]) [Link [Str "Reno"] ("http://www.reno.gov","")] +,Header 4 ("",[],[]) [Str "Las",Space,Str "Vegas"] +,Header 4 ("",[],[]) [Str "Ely"] +,Header 4 ("",[],[]) [Str "Gerlach"] +,Header 3 ("",[],[]) [Str "Oregon"] +,Header 3 ("",[],[]) [Str "Washington"] +,Header 2 ("",[],[]) [Str "Great",Space,Str "Plains"] +,Header 3 ("",[],[]) [Str "Kansas"] +,Header 3 ("",[],[]) [Str "Nebraska"] +,Header 3 ("",[],[]) [Str "North",Space,Str "Dakota"] +,Header 3 ("",[],[]) [Str "Oklahoma"] +,Header 3 ("",[],[]) [Str "South",Space,Str "Dakota"] +,Header 2 ("",[],[]) [Str "Mid",Str "-",Str "Atlantic"] +,Header 3 ("",[],[]) [Str "Delaware"] +,Header 3 ("",[],[]) [Str "Maryland"] +,Header 3 ("",[],[]) [Str "New",Space,Str "Jersey"] +,Header 3 ("",[],[]) [Str "New",Space,Str "York"] +,Header 3 ("",[],[]) [Str "Pennsylvania"] +,Header 2 ("",[],[]) [Str "Midwest"] +,Header 3 ("",[],[]) [Str "Illinois"] +,Header 3 ("",[],[]) [Str "Indiana"] +,Header 3 ("",[],[]) [Str "Iowa"] +,Header 3 ("",[],[]) [Str "Kentucky"] +,Header 3 ("",[],[]) [Str "Michigan"] +,Header 3 ("",[],[]) [Str "Minnesota"] +,Header 3 ("",[],[]) [Str "Missouri"] +,Header 3 ("",[],[]) [Str "Ohio"] +,Header 3 ("",[],[]) [Str "West",Space,Str "Virginia"] +,Header 3 ("",[],[]) [Str "Wisconsin"] +,Header 2 ("",[],[]) [Str "Mountains"] +,Header 3 ("",[],[]) [Str "Colorado"] +,Header 3 ("",[],[]) [Str "Idaho"] +,Header 3 ("",[],[]) [Str "Montana"] +,Header 3 ("",[],[]) [Str "Utah"] +,Header 3 ("",[],[]) [Str "Wyoming"] +,Header 2 ("",[],[]) [Str "New",Space,Str "England"] +,Header 3 ("",[],[]) [Str "Connecticut"] +,Header 3 ("",[],[]) [Str "Maine"] +,Header 3 ("",[],[]) [Str "Massachusetts"] +,Header 3 ("",[],[]) [Str "New",Space,Str "Hampshire"] +,Header 3 ("",[],[]) [Str "Rhode",Space,Str "Island"] +,Header 3 ("",[],[]) [Str "Vermont"] +,Header 2 ("",[],[]) [Str "South"] +,Header 3 ("",[],[]) [Str "Alabama"] +,Header 3 ("",[],[]) [Str "Arkansas"] +,Header 3 ("",[],[]) [Str "Florida"] +,Header 3 ("",[],[]) [Str "Georgia"] +,Header 3 ("",[],[]) [Str "Louisiana"] +,Header 3 ("",[],[]) [Str "Mississippi"] +,Header 3 ("",[],[]) [Str "North",Space,Str "Carolina"] +,Header 3 ("",[],[]) [Str "South",Space,Str "Carolina"] +,Header 3 ("",[],[]) [Str "Tennessee"] +,Header 3 ("",[],[]) [Str "Virginia"] +,Header 2 ("",[],[]) [Str "Southwest"] +,Header 3 ("",[],[]) [Str "Arizona"] +,Header 3 ("",[],[]) [Str "New",Space,Str "Mexico"] +,Header 3 ("",[],[]) [Str "Texas"]] diff --git a/tests/opml-reader.opml b/tests/opml-reader.opml new file mode 100644 index 000000000..54dd592ea --- /dev/null +++ b/tests/opml-reader.opml @@ -0,0 +1,91 @@ + + + + states.opml + Tue, 15 Mar 2005 16:35:45 GMT + Thu, 14 Jul 2005 23:41:05 GMT + Dave Winer + dave@scripting.com + 1, 6, 13, 16, 18, 20 + 1 + 106 + 106 + 558 + 479 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3