Open mouse07410 opened 4 years ago
After installing Pandoc via Stack (there was Cabal-built executable on the PATH before that), the errors changed, but still no success:
$ stack exec make
pandoc -c css/style.css --filter includes.hs --template template.html -s -f markdown -t html --standalone --toc --toc-depth=2 --mathjax="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --highlight-style pygments -o 000_introduction.html 000_introduction.md
includes.hs:19:28: error:
• Couldn't match type ‘Data.Text.Internal.Text’ with ‘[Char]’
Expected type: Maybe String
Actual type: Maybe Data.Text.Internal.Text
• In the second argument of ‘(=<<)’, namely
‘lookup "upper" namevals’
In a stmt of a 'do' block:
upper <- readMaybe =<< lookup "upper" namevals
In the second argument of ‘($)’, namely
‘do upper <- readMaybe =<< lookup "upper" namevals
lower <- readMaybe =<< lookup "lower" namevals
file <- lookup "slice" namevals
return (upper, lower, file)’
|
19 | upper <- readMaybe =<< lookup "upper" namevals
| ^^^^^^^^^^^^^^^^^^^^^^^
includes.hs:20:28: error:
• Couldn't match type ‘Data.Text.Internal.Text’ with ‘[Char]’
Expected type: Maybe String
Actual type: Maybe Data.Text.Internal.Text
• In the second argument of ‘(=<<)’, namely
‘lookup "lower" namevals’
In a stmt of a 'do' block:
lower <- readMaybe =<< lookup "lower" namevals
In the second argument of ‘($)’, namely
‘do upper <- readMaybe =<< lookup "upper" namevals
lower <- readMaybe =<< lookup "lower" namevals
file <- lookup "slice" namevals
return (upper, lower, file)’
|
20 | lower <- readMaybe =<< lookup "lower" namevals
| ^^^^^^^^^^^^^^^^^^^^^^^
includes.hs:27:28: error:
• Couldn't match type ‘Data.Text.Internal.Text’ with ‘[Char]’
Expected type: FilePath
Actual type: Data.Text.Internal.Text
• In the first argument of ‘readFile’, namely ‘f’
In a stmt of a 'do' block: contents <- readFile f
In the expression:
do contents <- readFile f
let lns = unlines $ slice lower upper (lines contents)
return (CodeBlock (id, classes, namevals) lns)
|
27 | contents <- readFile f
| ^
includes.hs:29:49: error:
• Couldn't match type ‘[Char]’ with ‘Data.Text.Internal.Text’
Expected type: Data.Text.Internal.Text
Actual type: String
• In the second argument of ‘CodeBlock’, namely ‘lns’
In the first argument of ‘return’, namely
‘(CodeBlock (id, classes, namevals) lns)’
In a stmt of a 'do' block:
return (CodeBlock (id, classes, namevals) lns)
|
29 | return (CodeBlock (id, classes, namevals) lns)
| ^^^
includes.hs:35:71: error:
• Couldn't match type ‘[Char]’ with ‘Data.Text.Internal.Text’
Expected type: IO Data.Text.Internal.Text
Actual type: IO String
• In the second argument of ‘(=<<)’, namely ‘readFile f’
In the expression:
return . (CodeBlock (id, classes, namevals)) =<< readFile f
In a case alternative:
Just f
-> return . (CodeBlock (id, classes, namevals)) =<< readFile f
|
35 | Just f -> return . (CodeBlock (id, classes, namevals)) =<< readFile f
| ^^^^^^^^^^
includes.hs:35:80: error:
• Couldn't match type ‘Data.Text.Internal.Text’ with ‘[Char]’
Expected type: FilePath
Actual type: Data.Text.Internal.Text
• In the first argument of ‘readFile’, namely ‘f’
In the second argument of ‘(=<<)’, namely ‘readFile f’
In the expression:
return . (CodeBlock (id, classes, namevals)) =<< readFile f
|
35 | Just f -> return . (CodeBlock (id, classes, namevals)) =<< readFile f
| ^
includes.hs:42:53: error:
• Couldn't match type ‘[Char]’ with ‘Data.Text.Internal.Text’
Expected type: IO Data.Text.Internal.Text
Actual type: IO String
• In the second argument of ‘(=<<)’, namely ‘readFile f’
In the expression: return . (RawBlock "html") =<< readFile f
In a case alternative:
Just f -> return . (RawBlock "html") =<< readFile f
|
42 | Just f -> return . (RawBlock "html") =<< readFile f
| ^^^^^^^^^^
includes.hs:42:62: error:
• Couldn't match type ‘Data.Text.Internal.Text’ with ‘[Char]’
Expected type: FilePath
Actual type: Data.Text.Internal.Text
• In the first argument of ‘readFile’, namely ‘f’
In the second argument of ‘(=<<)’, namely ‘readFile f’
In the expression: return . (RawBlock "html") =<< readFile f
|
42 | Just f -> return . (RawBlock "html") =<< readFile f
| ^
includes.hs:53:51: error:
• Couldn't match type ‘[Char]’ with ‘Data.Text.Internal.Text’
Expected type: Data.Text.Internal.Text
Actual type: String
• In the second argument of ‘($)’, namely ‘macros’
In the expression:
Div ("", [], [("style", "display:none")])
. (: []) . Para . (: []) . Math DisplayMath
$ macros
In a case alternative:
Format "html"
-> Div ("", [], [("style", "display:none")])
. (: []) . Para . (: []) . Math DisplayMath
$ macros
|
53 | . Para . (:[]) . Math DisplayMath $ macros
| ^^^^^^
includes.hs:54:46: error:
• Couldn't match type ‘[Char]’ with ‘Data.Text.Internal.Text’
Expected type: Data.Text.Internal.Text
Actual type: String
• In the second argument of ‘RawBlock’, namely ‘macros’
In the expression: RawBlock "latex" macros
In a case alternative: Format "latex" -> RawBlock "latex" macros
|
54 | Format "latex" -> RawBlock "latex" macros
| ^^^^^^
includes.hs:55:45: error:
• Couldn't match type ‘[Char]’ with ‘Data.Text.Internal.Text’
Expected type: Data.Text.Internal.Text
Actual type: String
• In the second argument of ‘RawBlock’, namely ‘macros’
In the expression: RawBlock "latex" macros
In a case alternative: Format "epub" -> RawBlock "latex" macros
|
55 | Format "epub" -> RawBlock "latex" macros
| ^^^^^^
Error running filter includes.hs:
Filter returned error status 1
make: *** [000_introduction.html] Error 83
Also, EPUB versions of this ebook, and or "What I Wish I Knew..." fail to properly display on MacOS and iOS - all the command examples and such are displayed as empty gray boxes. It would be great if you could re-generate EPUB versions. Pre-built PDF files appear OK.
MacOS Catalina 10.15.5, GHC-8.8.3, Stack-2.3.1, current LaTeX (MacTeX-2020):
It would be great if you could help getting this book compiled/built. Thanks!