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
This commit is contained in:
fiddlosopher 2008-02-09 03:22:01 +00:00
parent f6ea504b83
commit d4d905f8a8

15
Main.hs
View file

@ -49,9 +49,18 @@ copyrightMessage = "\nCopyright (C) 2006-7 John MacFarlane\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 = if null languages compileOptions =
then " [compiled without syntax highlighting support]" if null languages
else " [compiled with syntax highlighting support]" 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. -- | Association list of formats and readers.
readers :: [(String, ParserState -> String -> Pandoc)] readers :: [(String, ParserState -> String -> Pandoc)]