aboutsummaryrefslogtreecommitdiff
path: root/Main.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-02-09 03:21:19 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-02-09 03:21:19 +0000
commit04b32451be96cc64e3c8ee37a4b099ffe6236146 (patch)
tree197c78f2332f728ea63238aa972ab01e7d1ab4ed /Main.hs
parent427c2e484ded241d073e80b3a90be0005509a085 (diff)
downloadpandoc-04b32451be96cc64e3c8ee37a4b099ffe6236146.tar.gz
Added build option for syntax highlighting, with *optional* dependency on highlighting-kate.
+ pandoc.cabal includes a flag, 'highlighting', that causes a dependency on highlighting-kate. + if Setup.hs detects this dependency, it copies templates/Highlighting.yes.hs to Text/Pandoc/Highlighting.hs. Otherwise, it copies templates/Highlighting.no.hs. + The HTML writer imports this new module instead of Text.Highlighting.Kate. The new module exports highlightHtml, which either uses highlighting-kate to perform syntax highlighting or automatically returns a failure code, depending on whether highlighting support was selected. + --version now prints information about whether syntax highlighting support is compiled in. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1221 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Main.hs b/Main.hs
index e25b0b1ad..5f198b349 100644
--- a/Main.hs
+++ b/Main.hs
@@ -32,6 +32,7 @@ module Main where
import Text.Pandoc
import Text.Pandoc.UTF8
import Text.Pandoc.Shared ( joinWithSep, HTMLMathMethod (..) )
+import Text.Pandoc.Highlighting ( languages )
import System.Environment ( getArgs, getProgName, getEnvironment )
import System.Exit ( exitWith, ExitCode (..) )
import System.FilePath ( takeExtension )
@@ -47,6 +48,11 @@ copyrightMessage = "\nCopyright (C) 2006-7 John MacFarlane\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 = if null languages
+ then " [compiled without syntax highlighting support]"
+ else " [compiled with syntax highlighting support]"
+
-- | Association list of formats and readers.
readers :: [(String, ParserState -> String -> Pandoc)]
readers = [("native" , readPandoc)
@@ -315,7 +321,7 @@ options =
(NoArg
(\_ -> do
prg <- getProgName
- hPutStrLn stderr (prg ++ " " ++ pandocVersion ++
+ hPutStrLn stderr (prg ++ " " ++ pandocVersion ++ compileOptions ++
copyrightMessage)
exitWith $ ExitFailure 4))
"" -- "Print version"