git.iko.soy/typeable/pandoc
on master help sign in
Removed Text.Pandoc.S5 -- no longer needed.
commit21d74289ce343b83715d8f8f63b8ad31f0c7b237 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 21 Nov 2011, 15:26 (15 years ago) parentaf085e0
2 files changed−70
pandoc.cabal−1 src/Text/Pandoc/S5.hs−69
pandoc.cabal−1
@@ -265,7 +265,6 @@ Library
265265 Text.Pandoc.Writers.RTF,
266266 Text.Pandoc.Writers.ODT,
267267 Text.Pandoc.Writers.EPUB,
268− Text.Pandoc.S5,
269268 Text.Pandoc.Templates,
270269 Text.Pandoc.Biblio,
271270 Text.Pandoc.SelfContained
src/Text/Pandoc/S5.hsdeleted−69
@@ -1,69 +0,0 @@
1−{-
2−Copyright (C) 2006-2010 John MacFarlane <jgm@berkeley.edu>
3−
4−This program is free software; you can redistribute it and/or modify
5−it under the terms of the GNU General Public License as published by
6−the Free Software Foundation; either version 2 of the License, or
7−(at your option) any later version.
8−
9−This program is distributed in the hope that it will be useful,
10−but WITHOUT ANY WARRANTY; without even the implied warranty of
11−MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12−GNU General Public License for more details.
13−
14−You should have received a copy of the GNU General Public License
15−along with this program; if not, write to the Free Software
16−Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17−-}
18−
19−{- |
20− Module : Text.Pandoc.S5
21− Copyright : Copyright (C) 2006-2010 John MacFarlane
22− License : GNU GPL, version 2 or above
23−
24− Maintainer : John MacFarlane <jgm@berkeley.edu>
25− Stability : alpha
26− Portability : portable
27−
28−Definitions for creation of S5 powerpoint-like HTML.
29−(See <http://meyerweb.com/eric/tools/s5/>.)
30−-}
31−module Text.Pandoc.S5 ( s5HeaderIncludes) where
32−import Text.Pandoc.Shared ( readDataFile )
33−import System.FilePath ( (</>) )
34−import Data.ByteString.UTF8 ( toString, fromString )
35−import Data.ByteString.Base64 ( encode )
36−
37−s5HeaderIncludes :: Maybe FilePath -> IO String
38−s5HeaderIncludes datadir = do
39− c <- s5CSS datadir
40− j <- s5Javascript datadir
41− return $ c ++ j
42−
43−s5Javascript :: Maybe FilePath -> IO String
44−s5Javascript datadir = do
45− js <- readDataFile datadir $ "s5" </> "default" </> "slides.min.js"
46− return $ "<script type=\"text/javascript\">\n" ++ inCDATA js ++ "</script>\n"
47−
48−inCDATA :: String -> String
49−inCDATA s = "/*<![CDATA[*/\n" ++ s ++ "\n/*]]>*/\n"
50−
51−base64 :: String -> String
52−base64 = toString . encode . fromString
53−
54−s5CSS :: Maybe FilePath -> IO String
55−s5CSS datadir = do
56− s5CoreCSS <- readDataFile datadir $ "s5" </> "default" </> "s5-core.css"
57− s5FramingCSS <- readDataFile datadir $ "s5" </> "default" </> "framing.css"
58− s5PrettyCSS <- readDataFile datadir $ "s5" </> "default" </> "pretty.css"
59− s5OperaCSS <- readDataFile datadir $ "s5" </> "default" </> "opera.css"
60− s5OutlineCSS <- readDataFile datadir $ "s5" </> "default" </> "outline.css"
61− s5PrintCSS <- readDataFile datadir $ "s5" </> "default" </> "print.css"
62− return $ "<link rel=\"stylesheet\" type=\"text/css\" media=\"projection\" id=\"slideProj\" href=\"data:text/css;charset=utf-8;base64," ++
63− base64 (s5CoreCSS ++ "\n" ++ s5FramingCSS ++ "\n" ++ s5PrettyCSS) ++ "\" />\n" ++
64− "<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" id=\"outlineStyle\" href=\"data:text/css;charset=utf-8;base64," ++
65− base64 s5OutlineCSS ++ "\" />\n" ++
66− "<link rel=\"stylesheet\" type=\"text/css\" media=\"print\" id=\"slidePrint\" href=\"data:text/css;charset=utf-8;base64," ++
67− base64 s5PrintCSS ++ "\" />\n" ++
68− "<link rel=\"stylesheet\" type=\"text/css\" media=\"projection\" id=\"operaFix\" href=\"data:text/css;charset=utf-8;base64," ++
69− base64 s5OperaCSS ++ "\" />\n"