git.iko.soy/typeable/pandoc
on master help sign in
Revert "ALlow compilation with haddock-library 1.4 and above."

This reverts commit 50c71b5bc5db797ac46550ed54e91196269716e3. This was a bad idea, since tests depend on recent haddock-library. We'd be able to build but fail tests.

commitaff401745cc67f3cba6f6e04a40b81e227ecdde8 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 30 May 2018, 13:13 (8 years ago) parent50c71b5
2 files changed+2−15
pandoc.cabal+1−1 src/Text/Pandoc/Readers/Haddock.hs+1−14
pandoc.cabal+1−1
@@ -380,7 +380,7 @@ library
380380 hslua-module-text >= 0.1.2 && < 0.2,
381381 binary >= 0.5 && < 0.10,
382382 SHA >= 1.6 && < 1.7,
383− haddock-library >= 1.4 && < 1.7,
383+ haddock-library >= 1.6 && < 1.7,
384384 deepseq >= 1.3 && < 1.5,
385385 JuicyPixels >= 3.1.6.1 && < 3.3,
386386 Glob >= 0.7 && < 0.10,
src/Text/Pandoc/Readers/Haddock.hs+1−14
@@ -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