summaryrefslogtreecommitdiff
path: root/src/pandoc.hs
diff options
context:
space:
mode:
authordr@jones.dk <dr@jones.dk>2009-12-14 12:57:35 +0100
committerdr@jones.dk <dr@jones.dk>2009-12-14 12:57:35 +0100
commit789d0772d8b5d9c066fb8624bd51576cbde5e30b (patch)
tree7141187124ecc41b13861c81c7b642076cb88078 /src/pandoc.hs
parent88b315ccee666385e1a4c52e2eb5fb0b0ffe8d60 (diff)
Imported Upstream version 1.3
Diffstat (limited to 'src/pandoc.hs')
-rw-r--r--src/pandoc.hs25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/pandoc.hs b/src/pandoc.hs
index d6c45501e..c2cc9b75e 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -153,6 +153,8 @@ data Opt = Opt
, optSanitizeHTML :: Bool -- ^ Sanitize HTML
, optPlugins :: [Pandoc -> IO Pandoc] -- ^ Plugins to apply
, optEmailObfuscation :: ObfuscationMethod
+ , optIdentifierPrefix :: String
+ , optIndentedCodeClasses :: [String] -- ^ Default classes for indented code blocks
#ifdef _CITEPROC
, optBiblioFile :: String
, optBiblioFormat :: String
@@ -189,6 +191,8 @@ defaultOpts = Opt
, optSanitizeHTML = False
, optPlugins = []
, optEmailObfuscation = JavascriptObfuscation
+ , optIdentifierPrefix = ""
+ , optIndentedCodeClasses = []
#ifdef _CITEPROC
, optBiblioFile = []
, optBiblioFormat = []
@@ -312,6 +316,19 @@ options =
"none|javascript|references")
"" -- "Method for obfuscating email in HTML"
+ , Option "" ["id-prefix"]
+ (ReqArg
+ (\arg opt -> return opt { optIdentifierPrefix = arg })
+ "STRING")
+ "" -- "Prefix to add to automatically generated HTML identifiers"
+
+ , Option "" ["indented-code-classes"]
+ (ReqArg
+ (\arg opt -> return opt { optIndentedCodeClasses = words $
+ map (\c -> if c == ',' then ' ' else c) arg })
+ "STRING")
+ "" -- "Classes (whitespace- or comma-separated) to use for indented code-blocks"
+
, Option "" ["toc", "table-of-contents"]
(NoArg
(\opt -> return opt { optTableOfContents = True }))
@@ -531,6 +548,8 @@ main = do
, optWrapText = wrap
, optSanitizeHTML = sanitize
, optEmailObfuscation = obfuscationMethod
+ , optIdentifierPrefix = idPrefix
+ , optIndentedCodeClasses = codeBlockClasses
#ifdef _CITEPROC
, optBiblioFile = biblioFile
, optBiblioFormat = biblioFormat
@@ -586,7 +605,8 @@ main = do
stateSmart = smart || writerName' `elem`
["latex", "context", "man"],
stateColumns = columns,
- stateStrict = strict }
+ stateStrict = strict,
+ stateIndentedCodeClasses = codeBlockClasses }
let csslink = if null css
then ""
else concatMap
@@ -616,7 +636,8 @@ main = do
lhsExtension [outputFile],
writerEmailObfuscation = if strict
then ReferenceObfuscation
- else obfuscationMethod }
+ else obfuscationMethod,
+ writerIdentifierPrefix = idPrefix }
when (isNonTextOutput writerName' && outputFile == "-") $
do hPutStrLn stderr ("Error: Cannot write " ++ writerName ++ " output to stdout.\n" ++