@@ -44,13 +44,7 @@ readHaddockEither :: ReaderOptions -- ^ Reader options
4444 -> String -- ^ String to parse
4545 -> Either PandocError Pandoc
4646readHaddockEither _opts =
47−#if MIN_VERSION_haddock_library(1,6,0)
4847 Right . B.doc . docHToBlocks . _doc . parseParas Nothing
49−#elif MIN_VERSION_haddock_library(1,2,0)
50− Right . B.doc . docHToBlocks . _doc . parseParas
51−#else
52− Right . B.doc . docHToBlocks . parseParas
53−#endif
5448
5549docHToBlocks :: DocH String Identifier -> Blocks
5650docHToBlocks d' =
@@ -70,10 +64,8 @@ docHToBlocks d' =
7064 DocEmphasis _ -> inlineFallback
7165 DocMonospaced _ -> inlineFallback
7266 DocBold _ -> inlineFallback
73−#if MIN_VERSION_haddock_library(1,4,0)
7467 DocMathInline _ -> inlineFallback
7568 DocMathDisplay _ -> inlineFallback
76−#endif
7769 DocHeader h -> B.header (headerLevel h)
7870 (docHToInlines False $ headerTitle h)
7971 DocUnorderedList items -> B.bulletList (map docHToBlocks items)
@@ -89,7 +81,6 @@ docHToBlocks d' =
8981 DocProperty s -> B.codeBlockWith ("",["property","haskell"],[]) (trim s)
9082 DocExamples es -> mconcat $ map (\e ->
9183 makeExample ">>>" (exampleExpression e) (exampleResult e)) es
92−#if MIN_VERSION_haddock_library(1,5,0)
9384 DocTable H.Table{ tableHeaderRows = headerRows
9485 , tableBodyRows = bodyRows
9586 }
@@ -102,7 +93,7 @@ docHToBlocks d' =
10293 colspecs = replicate (maximum (map length body))
10394 (AlignDefault, 0.0)
10495 in B.table mempty colspecs header body
105−#endif
96+
10697 where inlineFallback = B.plain $ docHToInlines False d'
10798 consolidatePlains = B.fromList . consolidatePlains' . B.toList
10899 consolidatePlains' zs@(Plain _ : _) =
@@ -134,10 +125,8 @@ docHToInlines isCode d' =
134125 DocMonospaced (DocString s) -> B.code s
135126 DocMonospaced d -> docHToInlines True d
136127 DocBold d -> B.strong (docHToInlines isCode d)
137−#if MIN_VERSION_haddock_library(1,4,0)
138128 DocMathInline s -> B.math s
139129 DocMathDisplay s -> B.displayMath s
140−#endif
141130 DocHeader _ -> mempty
142131 DocUnorderedList _ -> mempty
143132 DocOrderedList _ -> mempty
@@ -150,9 +139,7 @@ docHToInlines isCode d' =
150139 DocAName s -> B.spanWith (s,["anchor"],[]) mempty
151140 DocProperty _ -> mempty
152141 DocExamples _ -> mempty
153−#if MIN_VERSION_haddock_library(1,5,0)
154142 DocTable _ -> mempty
155−#endif
156143
157144-- | Create an 'Example', stripping superfluous characters as appropriate
158145makeExample :: String -> String -> [String] -> Blocks