@@ -133,7 +133,7 @@ convertWithOpts opts args = do
133 , optIncremental = incremental
133 , optIncremental = incremental
134 , optSelfContained = selfContained
134 , optSelfContained = selfContained
135 , optHtmlQTags = htmlQTags
135 , optHtmlQTags = htmlQTags
136− , optHighlightStyle = highlightStyle
136+ , optHighlightStyle = mbHighlightStyle
137 , optTopLevelDivision = topLevelDivision
137 , optTopLevelDivision = topLevelDivision
138 , optHTMLMathMethod = mathMethod'
138 , optHTMLMathMethod = mathMethod'
139 , optReferenceDoc = referenceDoc
139 , optReferenceDoc = referenceDoc
@@ -309,6 +309,8 @@ convertWithOpts opts args = do
309 , readerTrackChanges = trackChanges
309 , readerTrackChanges = trackChanges
312+ highlightStyle <- lookupHighlightStyle mbHighlightStyle
312 let writerOptions = def { writerTemplate = templ,
314 let writerOptions = def { writerTemplate = templ,
313 writerVariables = variables'',
315 writerVariables = variables'',
314 writerTabStop = tabStop,
316 writerTabStop = tabStop,
@@ -534,14 +536,14 @@ data Opt = Opt
534 , optTemplate :: Maybe FilePath -- ^ Custom template
536 , optTemplate :: Maybe FilePath -- ^ Custom template
535 , optVariables :: [(String,String)] -- ^ Template variables to set
537 , optVariables :: [(String,String)] -- ^ Template variables to set
536 , optMetadata :: M.Map String MetaValue -- ^ Metadata fields to set
538 , optMetadata :: M.Map String MetaValue -- ^ Metadata fields to set
537− , optOutputFile :: String -- ^ Name of output file
539+ , optOutputFile :: FilePath -- ^ Name of output file
538 , optNumberSections :: Bool -- ^ Number sections in LaTeX
540 , optNumberSections :: Bool -- ^ Number sections in LaTeX
539 , optNumberOffset :: [Int] -- ^ Starting number for sections
541 , optNumberOffset :: [Int] -- ^ Starting number for sections
540 , optSectionDivs :: Bool -- ^ Put sections in div tags in HTML
542 , optSectionDivs :: Bool -- ^ Put sections in div tags in HTML
541 , optIncremental :: Bool -- ^ Use incremental lists in Slidy/Slideous/S5
543 , optIncremental :: Bool -- ^ Use incremental lists in Slidy/Slideous/S5
542 , optSelfContained :: Bool -- ^ Make HTML accessible offline
544 , optSelfContained :: Bool -- ^ Make HTML accessible offline
543 , optHtmlQTags :: Bool -- ^ Use <q> tags in HTML
545 , optHtmlQTags :: Bool -- ^ Use <q> tags in HTML
544− , optHighlightStyle :: Maybe Style -- ^ Style to use for highlighted code
546+ , optHighlightStyle :: Maybe String -- ^ Style to use for highlighted code
545 , optTopLevelDivision :: TopLevelDivision -- ^ Type of the top-level divisions
547 , optTopLevelDivision :: TopLevelDivision -- ^ Type of the top-level divisions
546 , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math
548 , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math
547 , optReferenceDoc :: Maybe FilePath -- ^ Path of reference doc
549 , optReferenceDoc :: Maybe FilePath -- ^ Path of reference doc
@@ -600,7 +602,7 @@ defaultOpts = Opt
600 , optIncremental = False
602 , optIncremental = False
601 , optSelfContained = False
603 , optSelfContained = False
602 , optHtmlQTags = False
604 , optHtmlQTags = False
603− , optHighlightStyle = Just pygments
605+ , optHighlightStyle = Just "pygments"
604 , optTopLevelDivision = TopLevelDefault
606 , optTopLevelDivision = TopLevelDefault
605 , optHTMLMathMethod = PlainMath
607 , optHTMLMathMethod = PlainMath
606 , optReferenceDoc = Nothing
608 , optReferenceDoc = Nothing
@@ -840,10 +842,7 @@ options =
841 , Option "" ["highlight-style"]
843 , Option "" ["highlight-style"]
844− case lookup (map toLower arg) highlightingStyles of
845− Just s -> return opt{ optHighlightStyle = Just s }
845+ (\arg opt -> return opt{ optHighlightStyle = Just arg })
846− Nothing -> err 39 $ "Unknown style: " ++ arg)
848 "" -- "Style for highlighted code"
847 "" -- "Style for highlighted code"
@@ -1475,4 +1474,9 @@ writerFn :: MonadIO m => FilePath -> String -> m ()
1475writerFn "-" = liftIO . UTF8.putStr
1474writerFn "-" = liftIO . UTF8.putStr
1476writerFn f = liftIO . UTF8.writeFile f
1475writerFn f = liftIO . UTF8.writeFile f
1478−
1477+lookupHighlightStyle :: Maybe String -> IO (Maybe Style)
1478+lookupHighlightStyle Nothing = return Nothing
1479+lookupHighlightStyle (Just s) =
1480+ case lookup (map toLower s) highlightingStyles of
1481+ Just sty -> return (Just sty)
1482+ Nothing -> err 68 $ "Unknown highlight-style " ++ s