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
This commit is contained in:
fiddlosopher 2008-07-31 23:55:27 +00:00
parent 22846086c1
commit 8440385f45
5 changed files with 13 additions and 12 deletions

View file

@ -45,10 +45,10 @@ import Data.Char ( toLower )
import Control.Monad ( (>>=) ) import Control.Monad ( (>>=) )
copyrightMessage :: String copyrightMessage :: String
copyrightMessage = "\nCopyright (C) 2006-7 John MacFarlane\n\ copyrightMessage = "\nCopyright (C) 2006-7 John MacFarlane\n" ++
\Web: http://johnmacfarlane.net/pandoc\n\ "Web: http://johnmacfarlane.net/pandoc\n" ++
\This is free software; see the source for copying conditions. There is no\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." "warranty, not even for merchantability or fitness for a particular purpose."
compileOptions :: String compileOptions :: String
compileOptions = compileOptions =

View file

@ -49,8 +49,8 @@ fillDefaultHeadersTemplate = do
writeTemplate :: FilePath -> String -> IO () writeTemplate :: FilePath -> String -> IO ()
writeTemplate outfile contents = do writeTemplate outfile contents = do
putStrLn $ " " ++ outfile putStrLn $ " " ++ outfile
let warning = "-- This file is generated from a template in the templates subdirectory.\n\ let warning = "-- This file is generated from a template in the templates subdirectory.\n" ++
\-- Modify that file, not this one.\n" "-- Modify that file, not this one.\n"
writeFile outfile (warning ++ contents) writeFile outfile (warning ++ contents)
-- Read contents of fpath and insert in template replacing @fpath@. -- Read contents of fpath and insert in template replacing @fpath@.

View file

@ -209,10 +209,10 @@ blockToLaTeX (Table caption aligns widths heads rows) = do
headers $$ text "\\hline" $$ vcat rows' $$ headers $$ text "\\hline" $$ vcat rows' $$
text "\\end{tabular}" text "\\end{tabular}"
let centered txt = text "\\begin{center}" $$ txt $$ text "\\end{center}" let centered txt = text "\\begin{center}" $$ txt $$ text "\\end{center}"
addToHeader "\\usepackage{array}\n\ addToHeader $ "\\usepackage{array}\n" ++
\% This is needed because raggedright in table elements redefines \\\\:\n\ "% This is needed because raggedright in table elements redefines \\\\:\n" ++
\\\newcommand{\\PreserveBackslash}[1]{\\let\\temp=\\\\#1\\let\\\\=\\temp}\n\ "\\newcommand{\\PreserveBackslash}[1]{\\let\\temp=\\\\#1\\let\\\\=\\temp}\n" ++
\\\let\\PBS=\\PreserveBackslash" "\\let\\PBS=\\PreserveBackslash"
return $ if isEmpty captionText return $ if isEmpty captionText
then centered tableBody <> char '\n' then centered tableBody <> char '\n'
else text "\\begin{table}[h]" $$ centered tableBody $$ else text "\\begin{table}[h]" $$ centered tableBody $$

View file

@ -291,8 +291,8 @@ inlineToRST (Code str) = return $ text $ "``" ++ str ++ "``"
inlineToRST (Str str) = return $ text $ escapeString str inlineToRST (Str str) = return $ text $ escapeString str
inlineToRST (Math str) = do inlineToRST (Math str) = do
includes <- get >>= (return . stIncludes) includes <- get >>= (return . stIncludes)
let rawMathRole = ".. role:: math(raw)\n\ let rawMathRole = ".. role:: math(raw)\n" ++
\ :format: html latex\n" " :format: html latex\n"
if not (rawMathRole `elem` includes) if not (rawMathRole `elem` includes)
then modify $ \st -> st { stIncludes = rawMathRole : includes } then modify $ \st -> st { stIncludes = rawMathRole : includes }
else return () else return ()

View file

@ -111,6 +111,7 @@ Library
Other-Modules: Text.Pandoc.XML Other-Modules: Text.Pandoc.XML
Ghc-Options: -O2 -Wall -threaded Ghc-Options: -O2 -Wall -threaded
Ghc-Prof-Options: -auto-all Ghc-Prof-Options: -auto-all
Extensions: CPP
if flag(library) if flag(library)
Buildable: True Buildable: True