Slides in Literate Haskell with Pandoc Dom De Re 7 July, 2014 - - PowerPoint PPT Presentation

slides in literate haskell with pandoc
SMART_READER_LITE
LIVE PREVIEW

Slides in Literate Haskell with Pandoc Dom De Re 7 July, 2014 - - PowerPoint PPT Presentation

Slides in Literate Haskell with Pandoc Dom De Re 7 July, 2014 Slides in Literate Haskell Pandoc You will need Pandoc Pandoc gets the Literate Haskell source file (or Markdown file) and marks it up into slides. Installing Pandoc On Ubuntu ,


slide-1
SLIDE 1

Slides in Literate Haskell with Pandoc

Dom De Re 7 July, 2014

slide-2
SLIDE 2

Slides in Literate Haskell

slide-3
SLIDE 3

Pandoc

slide-4
SLIDE 4

You will need Pandoc

Pandoc gets the Literate Haskell source file (or Markdown file) and marks it up into slides.

slide-5
SLIDE 5

Installing Pandoc

◮ On Ubuntu, you can install it with the package manager:

sudo apt-get install pandoc

◮ However if you are rendering a Literate Haskell file, you are

likely to be familiar with cabal and ghc, in which case you can install it like you would any other Haskell binary off Hackage.

slide-6
SLIDE 6

LaTeX and Beamer

slide-7
SLIDE 7

Installing LaTeX and Beamer

If you wish to build the beamer target, you will need to install the latex-beamer package with: sudo apt-get install latex-beamer

slide-8
SLIDE 8

Write Slides

slide-9
SLIDE 9

You can write your slides in Github flavoured Markdown mixed with or without Literate Haskell

slide-10
SLIDE 10

Github Flavoured Markdown Example

A Python excerpt: def erp(r, x): print("erpderp")

slide-11
SLIDE 11

Literate Haskell 1 (Bird Style)

Ordinarily in Markdown, a > character at the beginning of a line would signify a quote block. When using Literate Haskell however, a > at the beginning of a line will signify a line of Haskell code that you want both marked up in the slides and compiled into the module foldr’ :: (a -> b -> b) -> b -> [a] -> b foldr’ _ y [] = y foldr’ f y (x:xs) = f x (foldr’ f y xs)

slide-12
SLIDE 12

Literate Haskell 2

If you want to write broken code without it stopping the module from compiling, there are two ways to do it. You can start the line with a < char instead of a > char:

  • - | This wouldn’t compile

foo :: a -> b foo x = x Or you can embed Haskell code the way you already would in Github Flavoured Markdown:

  • - | This would not compile either

foo2 :: (s -> a) -> (s -> b -> t) -> (a -> b) -> s -> t foo2 g s w x = g s

slide-13
SLIDE 13

Building The Slides

slide-14
SLIDE 14

pandoc can output a wide variety of formats, right now, the included Makefile only builds a small subset of them

slide-15
SLIDE 15

Reveal.js

Build the slides with: make revealjs By default it uses the sky theme and sets the slide-level to 2 Output goes to revealjs/index.html

slide-16
SLIDE 16

Beamer

Build the slides with: make beamer It uses the default theme and also sets the slide-level to 2 Output goes to beamer/talk.pdf