summaryrefslogtreecommitdiff
path: root/src/pandoc.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/pandoc.hs')
-rw-r--r--src/pandoc.hs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/pandoc.hs b/src/pandoc.hs
index c0f457449..e73f05965 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -123,6 +123,7 @@ data Opt = Opt
, optBibliography :: [String]
, optCslFile :: FilePath
, optListings :: Bool -- ^ Use listings package for code blocks
+ , optAscii :: Bool -- ^ Avoid using nonascii characters
}
-- | Defaults for command-line options.
@@ -166,6 +167,7 @@ defaultOpts = Opt
, optBibliography = []
, optCslFile = ""
, optListings = False
+ , optAscii = False
}
-- | A list of functions, each transforming the options data structure
@@ -347,6 +349,11 @@ options =
"NUMBER")
"" -- "Length of line in characters"
+ , Option "" ["ascii"]
+ (NoArg
+ (\opt -> return opt { optAscii = True }))
+ "" -- "Avoid using non-ascii characters in output"
+
, Option "" ["email-obfuscation"]
(ReqArg
(\arg opt -> do
@@ -681,7 +688,8 @@ main = do
, optBibliography = reffiles
, optCslFile = cslfile
, optCiteMethod = citeMethod
- , optListings = listings
+ , optListings = listings
+ , optAscii = ascii
} = opts
when dumpArgs $
@@ -803,7 +811,8 @@ main = do
writerHtml5 = html5 &&
"html" `isPrefixOf` writerName',
writerChapters = chapters,
- writerListings = listings }
+ writerListings = listings,
+ writerAscii = ascii }
when (isNonTextOutput writerName' && outputFile == "-") $
do UTF8.hPutStrLn stderr ("Error: Cannot write " ++ writerName ++ " output to stdout.\n" ++