diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-08-01 23:29:55 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-08-01 23:29:55 +0000 |
commit | e371db97d7de5188b89b9f77749b47c20ef958de (patch) | |
tree | 630b3c96d5bb766a154ff474de52118b57847b54 /Text/Pandoc | |
parent | 5c1c786d6590b105dc2802a16eb9c599ec06912c (diff) | |
download | pandoc-e371db97d7de5188b89b9f77749b47c20ef958de.tar.gz |
Fixes to make haddock work with template haskell:
+ Added CPP, TemplateHaskell, FlexibleInstances to cabal file "Extensions" field
+ Added #ifndef __HADDOCK__ cpp declarations in the files using template haskell.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1366 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Text/Pandoc')
-rw-r--r-- | Text/Pandoc/ASCIIMathML.hs | 4 | ||||
-rw-r--r-- | Text/Pandoc/DefaultHeaders.hs | 12 | ||||
-rw-r--r-- | Text/Pandoc/Writers/S5.hs | 16 |
3 files changed, 29 insertions, 3 deletions
diff --git a/Text/Pandoc/ASCIIMathML.hs b/Text/Pandoc/ASCIIMathML.hs index 72a1f0e19..829779e41 100644 --- a/Text/Pandoc/ASCIIMathML.hs +++ b/Text/Pandoc/ASCIIMathML.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE CPP, TemplateHaskell #-} -- | Definitions for use of ASCIIMathML in HTML. -- (See <http://www1.chapman.edu/~jipsen/mathml/asciimath.html>.) module Text.Pandoc.ASCIIMathML ( asciiMathMLScript ) where @@ -7,6 +7,8 @@ import System.FilePath ( (</>) ) -- | String containing ASCIIMathML javascript. asciiMathMLScript :: String +#ifndef __HADDOCK__ asciiMathMLScript = "<script type=\"text/javascript\">\n" ++ $(contentsOf $ "data" </> "ASCIIMathML.js.comment") ++ $(contentsOf $ "data" </> "ASCIIMathML.js.packed") ++ "</script>\n" +#endif diff --git a/Text/Pandoc/DefaultHeaders.hs b/Text/Pandoc/DefaultHeaders.hs index b918002d8..596313b1b 100644 --- a/Text/Pandoc/DefaultHeaders.hs +++ b/Text/Pandoc/DefaultHeaders.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE CPP, TemplateHaskell #-} {- Copyright (C) 2006-7 John MacFarlane <jgm@berkeley.edu> @@ -41,19 +41,29 @@ import System.FilePath ( (</>) ) import Text.Pandoc.Shared ( contentsOf ) defaultLaTeXHeader :: String +#ifndef __HADDOCK__ defaultLaTeXHeader = $(contentsOf $ "data" </> "headers" </> "LaTeX.header") +#endif defaultConTeXtHeader :: String +#ifndef __HADDOCK__ defaultConTeXtHeader = $(contentsOf $ "data" </> "headers" </> "ConTeXt.header") +#endif defaultDocbookHeader :: String +#ifndef __HADDOCK__ defaultDocbookHeader = $(contentsOf $ "data" </> "headers" </> "Docbook.header") +#endif defaultOpenDocumentHeader :: String +#ifndef __HADDOCK__ defaultOpenDocumentHeader = $(contentsOf $ "data" </> "headers" </> "OpenDocument.header") +#endif defaultS5Header :: String defaultS5Header = s5Meta ++ s5CSS ++ s5Javascript defaultRTFHeader :: String +#ifndef __HADDOCK__ defaultRTFHeader = $(contentsOf $ "data" </> "headers" </> "RTF.header") +#endif diff --git a/Text/Pandoc/Writers/S5.hs b/Text/Pandoc/Writers/S5.hs index e4cc9b08b..a00182ef0 100644 --- a/Text/Pandoc/Writers/S5.hs +++ b/Text/Pandoc/Writers/S5.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE CPP, TemplateHaskell #-} {- Copyright (C) 2006-7 John MacFarlane <jgm@berkeley.edu> @@ -50,27 +50,41 @@ s5Meta :: String s5Meta = "<!-- configuration parameters -->\n<meta name=\"defaultView\" content=\"slideshow\" />\n<meta name=\"controlVis\" content=\"hidden\" />\n" s5Javascript :: String +#ifndef __HADDOCK__ s5Javascript = "<script type=\"text/javascript\">\n" ++ $(contentsOf $ "data" </> "ui" </> "default" </> "slides.js.comment") ++ $(contentsOf $ "data" </> "ui" </> "default" </> "slides.js.packed") ++ "</script>\n" +#endif s5CoreCSS :: String +#ifndef __HADDOCK__ s5CoreCSS = $(contentsOf $ "data" </> "ui" </> "default" </> "s5-core.css") +#endif s5FramingCSS :: String +#ifndef __HADDOCK__ s5FramingCSS = $(contentsOf $ "data" </> "ui" </> "default" </> "framing.css") +#endif s5PrettyCSS :: String +#ifndef __HADDOCK__ s5PrettyCSS = $(contentsOf $ "data" </> "ui" </> "default" </> "pretty.css") +#endif s5OperaCSS :: String +#ifndef __HADDOCK__ s5OperaCSS = $(contentsOf $ "data" </> "ui" </> "default" </> "opera.css") +#endif s5OutlineCSS :: String +#ifndef __HADDOCK__ s5OutlineCSS = $(contentsOf $ "data" </> "ui" </> "default" </> "outline.css") +#endif s5PrintCSS :: String +#ifndef __HADDOCK__ s5PrintCSS = $(contentsOf $ "data" </> "ui" </> "default" </> "print.css") +#endif s5CSS :: String s5CSS = "<style type=\"text/css\" media=\"projection\" id=\"slideProj\">\n" ++ s5CoreCSS ++ "\n" ++ s5FramingCSS ++ "\n" ++ s5PrettyCSS ++ "\n</style>\n<style type=\"text/css\" media=\"projection\" id=\"operaFix\">\n" ++ s5OperaCSS ++ "\n</style>\n<style type=\"text/css\" media=\"screen\" id=\"outlineStyle\">\n" ++ s5OutlineCSS ++ "\n</style>\n<style type=\"text/css\" media=\"print\" id=\"slidePrint\">\n" ++ s5PrintCSS ++ "\n</style>\n" |