Use haddock-library 1.6.0.
This commit is contained in:
parent
41b205f4b0
commit
81ed7948da
4 changed files with 4 additions and 15 deletions
|
@ -380,7 +380,7 @@ library
|
||||||
hslua-module-text >= 0.1.2 && < 0.2,
|
hslua-module-text >= 0.1.2 && < 0.2,
|
||||||
binary >= 0.5 && < 0.10,
|
binary >= 0.5 && < 0.10,
|
||||||
SHA >= 1.6 && < 1.7,
|
SHA >= 1.6 && < 1.7,
|
||||||
haddock-library >= 1.1 && < 1.6,
|
haddock-library >= 1.6 && < 1.7,
|
||||||
deepseq >= 1.3 && < 1.5,
|
deepseq >= 1.3 && < 1.5,
|
||||||
JuicyPixels >= 3.1.6.1 && < 3.3,
|
JuicyPixels >= 3.1.6.1 && < 3.3,
|
||||||
Glob >= 0.7 && < 0.10,
|
Glob >= 0.7 && < 0.10,
|
||||||
|
|
|
@ -44,11 +44,7 @@ readHaddockEither :: ReaderOptions -- ^ Reader options
|
||||||
-> String -- ^ String to parse
|
-> String -- ^ String to parse
|
||||||
-> Either PandocError Pandoc
|
-> Either PandocError Pandoc
|
||||||
readHaddockEither _opts =
|
readHaddockEither _opts =
|
||||||
#if MIN_VERSION_haddock_library(1,2,0)
|
Right . B.doc . docHToBlocks . _doc . parseParas Nothing
|
||||||
Right . B.doc . docHToBlocks . _doc . parseParas
|
|
||||||
#else
|
|
||||||
Right . B.doc . docHToBlocks . parseParas
|
|
||||||
#endif
|
|
||||||
|
|
||||||
docHToBlocks :: DocH String Identifier -> Blocks
|
docHToBlocks :: DocH String Identifier -> Blocks
|
||||||
docHToBlocks d' =
|
docHToBlocks d' =
|
||||||
|
@ -68,10 +64,8 @@ docHToBlocks d' =
|
||||||
DocEmphasis _ -> inlineFallback
|
DocEmphasis _ -> inlineFallback
|
||||||
DocMonospaced _ -> inlineFallback
|
DocMonospaced _ -> inlineFallback
|
||||||
DocBold _ -> inlineFallback
|
DocBold _ -> inlineFallback
|
||||||
#if MIN_VERSION_haddock_library(1,4,0)
|
|
||||||
DocMathInline _ -> inlineFallback
|
DocMathInline _ -> inlineFallback
|
||||||
DocMathDisplay _ -> inlineFallback
|
DocMathDisplay _ -> inlineFallback
|
||||||
#endif
|
|
||||||
DocHeader h -> B.header (headerLevel h)
|
DocHeader h -> B.header (headerLevel h)
|
||||||
(docHToInlines False $ headerTitle h)
|
(docHToInlines False $ headerTitle h)
|
||||||
DocUnorderedList items -> B.bulletList (map docHToBlocks items)
|
DocUnorderedList items -> B.bulletList (map docHToBlocks items)
|
||||||
|
@ -87,7 +81,6 @@ docHToBlocks d' =
|
||||||
DocProperty s -> B.codeBlockWith ("",["property","haskell"],[]) (trim s)
|
DocProperty s -> B.codeBlockWith ("",["property","haskell"],[]) (trim s)
|
||||||
DocExamples es -> mconcat $ map (\e ->
|
DocExamples es -> mconcat $ map (\e ->
|
||||||
makeExample ">>>" (exampleExpression e) (exampleResult e)) es
|
makeExample ">>>" (exampleExpression e) (exampleResult e)) es
|
||||||
#if MIN_VERSION_haddock_library(1,5,0)
|
|
||||||
DocTable H.Table{ tableHeaderRows = headerRows
|
DocTable H.Table{ tableHeaderRows = headerRows
|
||||||
, tableBodyRows = bodyRows
|
, tableBodyRows = bodyRows
|
||||||
}
|
}
|
||||||
|
@ -100,7 +93,6 @@ docHToBlocks d' =
|
||||||
colspecs = replicate (maximum (map length body))
|
colspecs = replicate (maximum (map length body))
|
||||||
(AlignDefault, 0.0)
|
(AlignDefault, 0.0)
|
||||||
in B.table mempty colspecs header body
|
in B.table mempty colspecs header body
|
||||||
#endif
|
|
||||||
|
|
||||||
where inlineFallback = B.plain $ docHToInlines False d'
|
where inlineFallback = B.plain $ docHToInlines False d'
|
||||||
consolidatePlains = B.fromList . consolidatePlains' . B.toList
|
consolidatePlains = B.fromList . consolidatePlains' . B.toList
|
||||||
|
@ -133,10 +125,8 @@ docHToInlines isCode d' =
|
||||||
DocMonospaced (DocString s) -> B.code s
|
DocMonospaced (DocString s) -> B.code s
|
||||||
DocMonospaced d -> docHToInlines True d
|
DocMonospaced d -> docHToInlines True d
|
||||||
DocBold d -> B.strong (docHToInlines isCode d)
|
DocBold d -> B.strong (docHToInlines isCode d)
|
||||||
#if MIN_VERSION_haddock_library(1,4,0)
|
|
||||||
DocMathInline s -> B.math s
|
DocMathInline s -> B.math s
|
||||||
DocMathDisplay s -> B.displayMath s
|
DocMathDisplay s -> B.displayMath s
|
||||||
#endif
|
|
||||||
DocHeader _ -> mempty
|
DocHeader _ -> mempty
|
||||||
DocUnorderedList _ -> mempty
|
DocUnorderedList _ -> mempty
|
||||||
DocOrderedList _ -> mempty
|
DocOrderedList _ -> mempty
|
||||||
|
@ -149,9 +139,7 @@ docHToInlines isCode d' =
|
||||||
DocAName s -> B.spanWith (s,["anchor"],[]) mempty
|
DocAName s -> B.spanWith (s,["anchor"],[]) mempty
|
||||||
DocProperty _ -> mempty
|
DocProperty _ -> mempty
|
||||||
DocExamples _ -> mempty
|
DocExamples _ -> mempty
|
||||||
#if MIN_VERSION_haddock_library(1,5,0)
|
|
||||||
DocTable _ -> mempty
|
DocTable _ -> mempty
|
||||||
#endif
|
|
||||||
|
|
||||||
-- | Create an 'Example', stripping superfluous characters as appropriate
|
-- | Create an 'Example', stripping superfluous characters as appropriate
|
||||||
makeExample :: String -> String -> [String] -> Blocks
|
makeExample :: String -> String -> [String] -> Blocks
|
||||||
|
|
|
@ -26,6 +26,6 @@ extra-deps:
|
||||||
- pandoc-citeproc-0.14.3.1
|
- pandoc-citeproc-0.14.3.1
|
||||||
- tagsoup-0.14.6
|
- tagsoup-0.14.6
|
||||||
- pandoc-types-1.17.4.2
|
- pandoc-types-1.17.4.2
|
||||||
- haddock-library-1.5.0.1
|
- haddock-library-1.6.0
|
||||||
- texmath-0.11
|
- texmath-0.11
|
||||||
resolver: lts-9.14
|
resolver: lts-9.14
|
||||||
|
|
|
@ -22,6 +22,7 @@ extra-deps:
|
||||||
- cmark-gfm-0.1.3
|
- cmark-gfm-0.1.3
|
||||||
- hslua-module-text-0.1.2.1
|
- hslua-module-text-0.1.2.1
|
||||||
- texmath-0.11
|
- texmath-0.11
|
||||||
|
- haddock-library-1.6.0
|
||||||
ghc-options:
|
ghc-options:
|
||||||
"$locals": -fhide-source-paths -XNoImplicitPrelude
|
"$locals": -fhide-source-paths -XNoImplicitPrelude
|
||||||
resolver: lts-10.10
|
resolver: lts-10.10
|
||||||
|
|
Loading…
Add table
Reference in a new issue