Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

epub format #74

Closed
reeze opened this issue Jan 7, 2016 · 12 comments
Closed

epub format #74

reeze opened this issue Jan 7, 2016 · 12 comments

Comments

@reeze
Copy link

reeze commented Jan 7, 2016

Thank you for you excellect book.
Could you generate an epub version of the book, that will be really helpful for portability ;)

@sdiehl
Copy link
Owner

sdiehl commented Jan 7, 2016

This was contributed by someone a while back:

https://github.com/sdiehl/write-you-a-haskell/blob/master/Makefile#L48

If you run

$ stac exec make epub

It should generate the file. I haven't really tested this much though.

@reeze
Copy link
Author

reeze commented Jan 8, 2016

Thanks!

it seems not working:

➜  write-you-a-haskell git:(master) stack exec make pdf
# pandoc --filter includes.hs -f markdown --template template.latex --latex-engine=xelatex --standalone --toc --toc-depth=2 --mathjax="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --highlight-style pygments -o WYAH.pdf title.md 0*.md contributing.md
pandoc --filter includes.hs -f markdown --template template.latex --latex-engine=xelatex --standalone --toc --toc-depth=2 --mathjax="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --highlight-style pygments -o WYAH.pdf title.md 000_introduction.md 001_basics.md 002_parsers.md 003_lambda_calculus.md 004_type_systems.md 005_evaluation.md 006_hindley_milner.md 007_path.md 008_extended_parser.md 009_datatypes.md 010_renamer.md 026_llvm.md
pandoc: Error running filter includes.hs
fd:4: hPutBuf: resource vanished (Broken pipe)
make: *** [pdf] Error 83

➜  write-you-a-haskell git:(master) stack exec make epub
pandoc --filter includes.hs -f markdown --standalone --toc --toc-depth=2 --mathjax="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --highlight-style pygments --epub-cover-image=img/cover-kindle.jpg -o WYAH.epub title.md 0*.md
pandoc: Error running filter includes.hs
fd:4: hPutBuf: resource vanished (Broken pipe)
make: *** [epub] Error 83

I am not sure what is the problem

@sdiehl
Copy link
Owner

sdiehl commented Jan 8, 2016

You'll need to compile includes.hs

$ stack exec ghc includes.hs

@sdiehl
Copy link
Owner

sdiehl commented Jan 11, 2016

Were you able to get it to build?

@reeze
Copy link
Author

reeze commented Jan 11, 2016

Hi,

➜  write-you-a-haskell git:(master) stack exec ghc includes.hs

includes.hs:4:8:
    Could not find module ‘Control.Monad.State’
    Perhaps you meant
      Control.Monad.ST (from base)
      Control.Monad.ST.Safe (from base)
      Control.Monad.Fix (from base)
    Use -v to see a list of the files searched for.

includes.hs:6:8:
    Could not find module ‘Text.Pandoc’
    Use -v to see a list of the files searched for.

includes.hs:10:8:
    Could not find module ‘Text.Pandoc.JSON’
    Use -v to see a list of the files searched for.

includes.hs:11:8:
    Could not find module ‘Text.Pandoc.Walk’
    Use -v to see a list of the files searched for.

Seems I need to install more libraries.

@sdiehl
Copy link
Owner

sdiehl commented Jan 11, 2016

Does running stack build add the libraries you need?

@reeze
Copy link
Author

reeze commented Jan 11, 2016

:( I got this:

➜  write-you-a-haskell git:(master) sudo stack build
Password:
base64-bytestring-1.0.0.1: configure
byteable-0.1.1: configure
cereal-0.4.1.1: configure
SHA-1.6.4.2: configure
Progress: 4/97
--  While building package SHA-1.6.4.2 using:
      /Users/reeze/.stack/setup-exe-cache/setup-Simple-Cabal-1.18.1.5-x86_64-osx-ghc-7.8.4 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.18.1.5/ configure --with-ghc=/usr/local/bin/ghc --user --package-db=clear --package-db=global --package-db=/Users/reeze/.stack/snapshots/x86_64-osx/lts-2.22/7.8.4/pkgdb/ --libdir=/Users/reeze/.stack/snapshots/x86_64-osx/lts-2.22/7.8.4/lib --bindir=/Users/reeze/.stack/snapshots/x86_64-osx/lts-2.22/7.8.4/bin --datadir=/Users/reeze/.stack/snapshots/x86_64-osx/lts-2.22/7.8.4/share --libexecdir=/Users/reeze/.stack/snapshots/x86_64-osx/lts-2.22/7.8.4/libexec --sysconfdir=/Users/reeze/.stack/snapshots/x86_64-osx/lts-2.22/7.8.4/etc --docdir=/Users/reeze/.stack/snapshots/x86_64-osx/lts-2.22/7.8.4/doc/SHA-1.6.4.2 --htmldir=/Users/reeze/.stack/snapshots/x86_64-osx/lts-2.22/7.8.4/doc/SHA-1.6.4.2 --haddockdir=/Users/reeze/.stack/snapshots/x86_64-osx/lts-2.22/7.8.4/doc/SHA-1.6.4.2 --constraint=array==0.5.0.0 --constraint=base==4.7.0.2 --constraint=binary==0.7.1.0 --constraint=bytestring==0.10.4.0 --constraint=directory==1.2.1.0
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/reeze/write-you-a-haskell/.stack-work/logs/SHA-1.6.4.2.log

    Configuring SHA-1.6.4.2...
    setup-Simple-Cabal-1.18.1.5-x86_64-osx-ghc-7.8.4: /usr/bin/ar: permission
    denied

@reeze
Copy link
Author

reeze commented Jan 11, 2016

Seems related to this: haskell/cabal#2653

@reeze
Copy link
Author

reeze commented Jan 11, 2016

I changed ghc to 7.10, it works:

diff --git a/stack.yaml b/stack.yaml
index 2af92ac..55f17a0 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -1,4 +1,4 @@
-resolver: lts-2.22
+resolver: lts-4.1
 packages:
 - '.'
 extra-deps: []
diff --git a/write-you-a-haskell.cabal b/write-you-a-haskell.cabal
index 4e9f295..1dcaccd 100644
--- a/write-you-a-haskell.cabal
+++ b/write-you-a-haskell.cabal
@@ -11,7 +11,6 @@ cabal-version:       >=1.10
 executable write-you-a-haskell
   main-is:             Main.hs
   build-depends:       
-    base         >= 4.7 && <4.8,
     pretty       >= 1.1 && <1.2,
     containers   >= 0.5 && <0.6,
     transformers >= 0.3 && <0.5,

sdiehl added a commit that referenced this issue Jan 19, 2016
Fix for issue #74 and compilation on osx mentioned therein
@mseri
Copy link
Contributor

mseri commented Jan 20, 2016

This should be now fixed on master with PR #75

@sdiehl
Copy link
Owner

sdiehl commented Jan 20, 2016

Nice, I'll close.

@sdiehl sdiehl closed this as completed Jan 20, 2016
@reeze
Copy link
Author

reeze commented Jan 21, 2016

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants