git.iko.soy/typeable/pandoc
on master help sign in
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

commitd4d905f8a84f1f2f7485d00447418c6f9fb574a9 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 9 Feb 2008, 03:22 (19 years ago) parentf6ea504
1 file changed+12−3
Main.hs+12−3
Main.hs+12−3
@@ -49,9 +49,18 @@ copyrightMessage = "\nCopyright (C) 2006-7 John MacFarlane\n\
4949 \warranty, not even for merchantability or fitness for a particular purpose."
5050
5151compileOptions :: String
52−compileOptions = if null languages
53− then " [compiled without syntax highlighting support]"
54− else " [compiled with syntax highlighting support]"
52+compileOptions =
53+ if null languages
54+ then "\nCompiled without syntax highlighting support."
55+ else "\nCompiled with syntax highlighting support for the following languages:\n" ++
56+ (unlines $ map unwords $ chunk 5 $
57+ map (\s -> s ++ replicate (15 - length s) ' ') languages)
58+
59+-- | Splits a list into groups of at most n.
60+chunk :: Int -> [a] -> [[a]]
61+chunk size lst =
62+ let (next, rest) = splitAt size lst
63+ in if null rest then [next] else next : chunk size rest
5564
5665-- | Association list of formats and readers.
5766readers :: [(String, ParserState -> String -> Pandoc)]