@@ -63,7 +63,10 @@ import qualified Data.Yaml as Yaml
6363import GHC.Generics
6464import Network.URI (URI (..), parseURI)
6565import Paths_pandoc (getDataDir)
66−import Skylighting (Style, Syntax (..), defaultSyntaxMap, parseTheme)
66+import Data.Aeson.Encode.Pretty (encodePretty', Config(..), keyOrder,
67+ defConfig, Indent(..), NumberFormat(..))
68+import Skylighting (Style, Syntax (..), defaultSyntaxMap, parseTheme,
69+ pygments)
6770import Skylighting.Parser (addSyntaxDefinition, missingIncludes,
6871 parseSyntaxDefinition)
6972import System.Console.GetOpt
@@ -1047,6 +1050,28 @@ options =
10471050 "FILE")
10481051 "" -- "Print default data file"
10491052
1053+ , Option "" ["print-highlight-style"]
1054+ (ReqArg
1055+ (\arg _ -> do
1056+ sty <- fromMaybe pygments <$>
1057+ lookupHighlightStyle (Just arg)
1058+ B.putStr $ encodePretty'
1059+ defConfig{confIndent = Spaces 4
1060+ ,confCompare = keyOrder
1061+ (map T.pack
1062+ ["text-color"
1063+ ,"background-color"
1064+ ,"line-numbers"
1065+ ,"bold"
1066+ ,"italic"
1067+ ,"underline"
1068+ ,"text-styles"])
1069+ ,confNumFormat = Generic
1070+ ,confTrailingNewline = True} sty
1071+ exitSuccess)
1072+ "STYLE|FILE")
1073+ "" -- "Print default template for FORMAT"
1074+
10501075 , Option "" ["dpi"]
10511076 (ReqArg
10521077 (\arg opt ->