Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
decker
decker
Commits
e8633cf3
Commit
e8633cf3
authored
Apr 22, 2018
by
Henrik Tramberend
Browse files
Refactor some inefficencies
parent
aae4e056
Changes
2
Show whitespace changes
Inline
Side-by-side
src/Common.hs
View file @
e8633cf3
...
...
@@ -39,6 +39,7 @@ isDevelopmentVersion =
-- | Tool specific exceptions
data
DeckerException
=
MustacheException
String
|
InternalException
String
|
ResourceException
String
|
GitException
String
|
PandocException
String
...
...
@@ -53,6 +54,7 @@ data DeckerException
instance
Exception
DeckerException
instance
Show
DeckerException
where
show
(
InternalException
e
)
=
e
show
(
MustacheException
e
)
=
e
show
(
ResourceException
e
)
=
e
show
(
GitException
e
)
=
e
...
...
src/Filter.hs
View file @
e8633cf3
...
...
@@ -29,7 +29,7 @@ import Data.List
import
Data.List.Split
import
Data.Maybe
import
Development.Shake
(
Action
)
import
Network.HTTP.Conduit
import
Network.HTTP.Conduit
hiding
(
InternalException
)
import
Network.HTTP.Simple
import
qualified
Network.URI
as
U
import
Network.URI
(
parseURI
,
uriScheme
)
...
...
@@ -285,23 +285,24 @@ mapSlides func (Pandoc meta blocks) =
makeSlides
::
Pandoc
->
Decker
Pandoc
makeSlides
pandoc
=
do
disp
<-
gets
disposition
let
chain
=
case
disp
of
Disposition
Deck
Html
->
return
$
walk
(
mapSlides
layoutSlides
)
$
walk
(
mapSlides
splitJoinColumns
)
$
walk
(
mapSlides
setSlideBackground
)
$
walk
(
mapSlides
wrapBoxes
)
$
walk
(
mapSlides
wrapNoteRevealjs
)
pandoc
layoutSlides
.
splitJoinColumns
.
setSlideBackground
.
wrapBoxes
.
wrapNoteRevealjs
-- TODO: Maybe we need some handout specific structure
Disposition
Handout
Html
->
layoutSlides
.
splitJoinColumns
.
wrapBoxes
.
wrapNoteRevealjs
-- TODO: Maybe we need some latex specific structure
Disposition
Handout
Pdf
->
Prelude
.
id
-- TODO: Probably not much to do here
Disposition
Page
Html
->
Prelude
.
id
-- TODO: Probably not much to do here
Disposition
Page
Pdf
->
Prelude
.
id
Disposition
Deck
Pdf
->
return
$
walk
(
mapSlides
layoutSlides
)
$
walk
(
mapSlides
splitJoinColumns
)
$
walk
(
mapSlides
setSlideBackground
)
$
walk
(
mapSlides
wrapBoxes
)
pandoc
Disposition
_
_
->
return
pandoc
-- TODO: Do this for pages
-- walk (mapSlides splitJoinColumns) $
-- walk (mapSlides setSlideBackground) $
-- walk (mapSlides wrapBoxes) pandoc
throw
$
InternalException
"PDF slide decks via LaTeX are not supported"
return
$
mapSlides
chain
pandoc
makeBoxes
::
Pandoc
->
Pandoc
makeBoxes
=
walk
(
mapSlides
wrapBoxes
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment