From 5b888e8b3be01aebb8ecf7ba4ebee61d2a3d3f31 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Thu, 27 Sep 2007 01:23:44 +0000 Subject: 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 --- src/Main.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/Main.hs') 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) . -- cgit v1.2.3