summaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-09-27 01:23:44 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-09-27 01:23:44 +0000
commit5b888e8b3be01aebb8ecf7ba4ebee61d2a3d3f31 (patch)
tree6e6d4dce4443d0bc0e8e6bf8ebeb10b28ea3cb81 /src/Main.hs
parentfa45b970c9b9e748728b58e9471e52139b770570 (diff)
Added a writer option for wrapped text and a command-line option
'--no-wrap', which disables text wrapping. (Resolves Issue #26.) + Added support for '--no-wrap' to Main.hs. + Added wrapIfNeeded function to Text.Pandoc.Shared. + Use wrapIfNeeded instead of wrapped in the RST, Man, Docbook, and Markdown writers. + Note: Not yet implemented in HTML, LaTeX, or ConTeXt writers. No documentation yet. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1034 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Main.hs b/src/Main.hs
index f985a9270..b3171c2b4 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -107,6 +107,7 @@ data Opt = Opt
, optIgnoreArgs :: Bool -- ^ Ignore command-line arguments
, optStrict :: Bool -- ^ Use strict markdown syntax
, optReferenceLinks :: Bool -- ^ Use reference links in writing markdown, rst
+ , optWrapText :: Bool -- ^ Wrap text
}
-- | Defaults for command-line options.
@@ -135,6 +136,7 @@ defaultOpts = Opt
, optIgnoreArgs = False
, optStrict = False
, optReferenceLinks = False
+ , optWrapText = True
}
-- | A list of functions, each transforming the options data structure
@@ -213,6 +215,11 @@ options =
(\opt -> return opt { optNumberSections = True }))
"" -- "Number sections in LaTeX"
+ , Option "" ["no-wrap"]
+ (NoArg
+ (\opt -> return opt { optWrapText = False }))
+ "" -- "Do not wrap text in output"
+
, Option "" ["toc", "table-of-contents"]
(NoArg
(\opt -> return opt { optTableOfContents = True }))
@@ -408,6 +415,7 @@ main = do
, optIgnoreArgs = ignoreArgs
, optStrict = strict
, optReferenceLinks = referenceLinks
+ , optWrapText = wrap
} = opts
if dumpArgs
@@ -491,7 +499,8 @@ main = do
writerIncludeBefore = includeBefore,
writerIncludeAfter = includeAfter,
writerStrictMarkdown = strict,
- writerReferenceLinks = referenceLinks }
+ writerReferenceLinks = referenceLinks,
+ writerWrapText = wrap }
(readSources sources) >>= (hPutStrLn output . toUTF8 .
(writer writerOptions) .