https://github.com/ehamberg/typeclassopedia-md
Markdown version of the Haskell Typeclassopedia
https://github.com/ehamberg/typeclassopedia-md
book epub haskell pandoc pdf
Last synced: 6 days ago
JSON representation
Markdown version of the Haskell Typeclassopedia
- Host: GitHub
- URL: https://github.com/ehamberg/typeclassopedia-md
- Owner: ehamberg
- Created: 2013-10-01T07:44:27.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T16:04:58.000Z (about 3 years ago)
- Last Synced: 2024-08-03T15:06:54.505Z (over 1 year ago)
- Topics: book, epub, haskell, pandoc, pdf
- Language: Makefile
- Homepage:
- Size: 513 KB
- Stars: 37
- Watchers: 8
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# E-book version of the Typeclassopedia
This is a Pandoc Markdown version of the
[Typeclassopedia](http://www.haskell.org/haskellwiki/Typeclassopedia) hosted on
the Haskell Wiki. The primary goal of the Markdown conversion was to be able to
convert the Typeclassopedia to an e-book in the EPUB format, thus making it
possible to highlight text and take notes while reading.
Running `make` will convert the Markdown file to EPUB using the excellent
[`pandoc`](http://johnmacfarlane.net/pandoc/) tool. This will also add syntax
highlighting to the code snippets and handle the footnotes.
To create the pdf using `nix-shell`:
nix-shell -p pandoc -p texlive.combined.scheme-small --run 'make pdf'
An up-to-date version of the EPUB file and the PDF file can be found in
[releases](https://github.com/ehamberg/typeclassopedia-md/releases).
To convert to different formats (e.g. for reading on a Kindle), the EPUB file
can be converted by using tools such as [Calibre](http://calibre-ebook.com/).
The following list shows the *Vim* commands that did the bulk of the work
converting from wiki syntax to Markdown:
:%s/\[\(http:\S*\) \(.\{-}\)\]/[\2](\1)/g
:%s,\(.\{-}\),`\1`,g
:%s,''\(.\{-}\)'',*\1*,g
:%s/^==\(.*\)==$/## \1/
:%s/^=\(.*\)=$/# \1/
:%s,^,```haskell,
:%s,^,```,
%s,\(.\{-}\),`\1`{.haskell},g
:%s,^{{note|\(.*\)}}$,> *\1*,
:%s,{{=}},=,g
:%s,\(.\{-}\),$\1$,g
:%s,\(.\{-}\),*\1*,g
:%s,^
:%s,\[\[\(.\{-}\)|\(.\{-}\)\]\],[\2](http://www.haskell.org/haskellwiki/\1),g
:%s,\[\[\(.\{-}\)\]\],[\1](http://www.haskell.org/haskellwiki/\1),g
:%s,\[{{HackageDocs|\(.*\)|\(.*\)}}\(\S*\) \(.\{-}\)\],[\4](https://hackage.haskell.org/package/\1/docs/\2.html\3),g
%s,\[\(http\S*\) \([^\]]*\)\],[\2](\1),g
The hard work in converting from the original article was already done for the
wiki conversion. So big thanks to Geheimdienst.