aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-02-09 03:22:01 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-02-09 03:22:01 +0000
commitd4d905f8a84f1f2f7485d00447418c6f9fb574a9 (patch)
treee7e3085a671d041e11fc16d43ba0d4551fdb81b9
parentf6ea504b83bbcf3e136bf7c31bc7a1a8be8820d7 (diff)
downloadpandoc-d4d905f8a84f1f2f7485d00447418c6f9fb574a9.tar.gz
Have --version print a list of supported languages for syntax highlighting.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1226 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r--Main.hs15
1 files changed, 12 insertions, 3 deletions
diff --git a/Main.hs b/Main.hs
index 5f198b349..4889ca30a 100644
--- a/Main.hs
+++ b/Main.hs
@@ -49,9 +49,18 @@ copyrightMessage = "\nCopyright (C) 2006-7 John MacFarlane\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]"
+compileOptions =
+ if null languages
+ then "\nCompiled without syntax highlighting support."
+ else "\nCompiled with syntax highlighting support for the following languages:\n" ++
+ (unlines $ map unwords $ chunk 5 $
+ map (\s -> s ++ replicate (15 - length s) ' ') languages)
+
+-- | Splits a list into groups of at most n.
+chunk :: Int -> [a] -> [[a]]
+chunk size lst =
+ let (next, rest) = splitAt size lst
+ in if null rest then [next] else next : chunk size rest
-- | Association list of formats and readers.
readers :: [(String, ParserState -> String -> Pandoc)]