aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-07-31 23:55:27 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-07-31 23:55:27 +0000
commit8440385f45e18f43172c0cf4409cf4b8b538bbeb (patch)
tree3b839e838163800ace3bc031484d86c3e75c0e6b
parent22846086c19b14a74c194ac06c1738f8bfd7fd46 (diff)
downloadpandoc-8440385f45e18f43172c0cf4409cf4b8b538bbeb.tar.gz
Compatibility fixes for CPP, Cabal, and haddock:
+ Use CPP in "Extensions" field in pandoc.cabal. + Removed use of backslash string continuations in source files. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1350 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r--Main.hs8
-rw-r--r--Setup.hs4
-rw-r--r--Text/Pandoc/Writers/LaTeX.hs8
-rw-r--r--Text/Pandoc/Writers/RST.hs4
-rw-r--r--pandoc.cabal1
5 files changed, 13 insertions, 12 deletions
diff --git a/Main.hs b/Main.hs
index fd303bc49..45d524acd 100644
--- a/Main.hs
+++ b/Main.hs
@@ -45,10 +45,10 @@ import Data.Char ( toLower )
import Control.Monad ( (>>=) )
copyrightMessage :: String
-copyrightMessage = "\nCopyright (C) 2006-7 John MacFarlane\n\
- \Web: http://johnmacfarlane.net/pandoc\n\
- \This is free software; see the source for copying conditions. There is no\n\
- \warranty, not even for merchantability or fitness for a particular purpose."
+copyrightMessage = "\nCopyright (C) 2006-7 John MacFarlane\n" ++
+ "Web: http://johnmacfarlane.net/pandoc\n" ++
+ "This is free software; see the source for copying conditions. There is no\n" ++
+ "warranty, not even for merchantability or fitness for a particular purpose."
compileOptions :: String
compileOptions =
diff --git a/Setup.hs b/Setup.hs
index b7fe4f7b5..2162f9860 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -49,8 +49,8 @@ fillDefaultHeadersTemplate = do
writeTemplate :: FilePath -> String -> IO ()
writeTemplate outfile contents = do
putStrLn $ " " ++ outfile
- let warning = "-- This file is generated from a template in the templates subdirectory.\n\
- \-- Modify that file, not this one.\n"
+ let warning = "-- This file is generated from a template in the templates subdirectory.\n" ++
+ "-- Modify that file, not this one.\n"
writeFile outfile (warning ++ contents)
-- Read contents of fpath and insert in template replacing @fpath@.
diff --git a/Text/Pandoc/Writers/LaTeX.hs b/Text/Pandoc/Writers/LaTeX.hs
index 57c763bdc..b523dea9e 100644
--- a/Text/Pandoc/Writers/LaTeX.hs
+++ b/Text/Pandoc/Writers/LaTeX.hs
@@ -209,10 +209,10 @@ blockToLaTeX (Table caption aligns widths heads rows) = do
headers $$ text "\\hline" $$ vcat rows' $$
text "\\end{tabular}"
let centered txt = text "\\begin{center}" $$ txt $$ text "\\end{center}"
- addToHeader "\\usepackage{array}\n\
- \% This is needed because raggedright in table elements redefines \\\\:\n\
- \\\newcommand{\\PreserveBackslash}[1]{\\let\\temp=\\\\#1\\let\\\\=\\temp}\n\
- \\\let\\PBS=\\PreserveBackslash"
+ addToHeader $ "\\usepackage{array}\n" ++
+ "% This is needed because raggedright in table elements redefines \\\\:\n" ++
+ "\\newcommand{\\PreserveBackslash}[1]{\\let\\temp=\\\\#1\\let\\\\=\\temp}\n" ++
+ "\\let\\PBS=\\PreserveBackslash"
return $ if isEmpty captionText
then centered tableBody <> char '\n'
else text "\\begin{table}[h]" $$ centered tableBody $$
diff --git a/Text/Pandoc/Writers/RST.hs b/Text/Pandoc/Writers/RST.hs
index 4b9f3da10..93a592132 100644
--- a/Text/Pandoc/Writers/RST.hs
+++ b/Text/Pandoc/Writers/RST.hs
@@ -291,8 +291,8 @@ inlineToRST (Code str) = return $ text $ "``" ++ str ++ "``"
inlineToRST (Str str) = return $ text $ escapeString str
inlineToRST (Math str) = do
includes <- get >>= (return . stIncludes)
- let rawMathRole = ".. role:: math(raw)\n\
- \ :format: html latex\n"
+ let rawMathRole = ".. role:: math(raw)\n" ++
+ " :format: html latex\n"
if not (rawMathRole `elem` includes)
then modify $ \st -> st { stIncludes = rawMathRole : includes }
else return ()
diff --git a/pandoc.cabal b/pandoc.cabal
index 8c78d9eb4..96fcfda53 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -111,6 +111,7 @@ Library
Other-Modules: Text.Pandoc.XML
Ghc-Options: -O2 -Wall -threaded
Ghc-Prof-Options: -auto-all
+ Extensions: CPP
if flag(library)
Buildable: True