diff options
Diffstat (limited to 'src/pandoc.hs')
-rw-r--r-- | src/pandoc.hs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/pandoc.hs b/src/pandoc.hs index 8811e6816..2068f5fc6 100644 --- a/src/pandoc.hs +++ b/src/pandoc.hs @@ -41,7 +41,7 @@ import System.Exit ( exitWith, ExitCode (..) ) import System.FilePath import System.Console.GetOpt import Data.Char ( toLower ) -import Data.List ( intercalate, isSuffixOf ) +import Data.List ( intercalate, isSuffixOf, isPrefixOf ) import System.Directory ( getAppUserDataDirectory, doesFileExist ) import System.IO ( stdout, stderr ) import qualified Text.Pandoc.UTF8 as UTF8 @@ -102,6 +102,7 @@ data Opt = Opt , optOffline :: Bool -- ^ Make slideshow accessible offline , optXeTeX :: Bool -- ^ Format latex for xetex , optSmart :: Bool -- ^ Use smart typography + , optHtml5 :: Bool -- ^ Produce HTML5 in HTML , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math , optReferenceODT :: Maybe FilePath -- ^ Path of reference.odt , optEPUBStylesheet :: Maybe String -- ^ EPUB stylesheet @@ -142,6 +143,7 @@ defaultOpts = Opt , optOffline = False , optXeTeX = False , optSmart = False + , optHtml5 = False , optHTMLMathMethod = PlainMath , optReferenceODT = Nothing , optEPUBStylesheet = Nothing @@ -226,6 +228,11 @@ options = (\opt -> return opt { optSmart = True })) "" -- "Use smart quotes, dashes, and ellipses" + , Option "5" ["html5"] + (NoArg + (\opt -> return opt { optHtml5 = True })) + "" -- "Produce HTML5 in HTML output" + , Option "m" ["latexmathml", "asciimathml"] (OptArg (\arg opt -> @@ -629,6 +636,7 @@ main = do , optOffline = offline , optXeTeX = xetex , optSmart = smart + , optHtml5 = html5 , optHTMLMathMethod = mathMethod , optReferenceODT = referenceODT , optEPUBStylesheet = epubStylesheet @@ -771,7 +779,9 @@ main = do else obfuscationMethod, writerIdentifierPrefix = idPrefix, writerSourceDirectory = sourceDir, - writerUserDataDir = datadir } + writerUserDataDir = datadir, + writerHtml5 = html5 && + "html" `isPrefixOf` writerName' } when (isNonTextOutput writerName' && outputFile == "-") $ do UTF8.hPutStrLn stderr ("Error: Cannot write " ++ writerName ++ " output to stdout.\n" ++ |