aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Texinfo.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-10-29 14:18:06 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-10-29 14:18:06 -0700
commitf270dd9b18de69e87198216f13943b2ceefea8f8 (patch)
tree63ac721a3a2c8ec2192eabc650bd0aff9ad1428b /src/Text/Pandoc/Writers/Texinfo.hs
parente45f2d1e9faa7835f01a9cc345f11b30c2377370 (diff)
downloadpandoc-f270dd9b18de69e87198216f13943b2ceefea8f8.tar.gz
hlint suggestions.
Diffstat (limited to 'src/Text/Pandoc/Writers/Texinfo.hs')
-rw-r--r--src/Text/Pandoc/Writers/Texinfo.hs26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/Text/Pandoc/Writers/Texinfo.hs b/src/Text/Pandoc/Writers/Texinfo.hs
index 549d4f3d9..2d0c7a86d 100644
--- a/src/Text/Pandoc/Writers/Texinfo.hs
+++ b/src/Text/Pandoc/Writers/Texinfo.hs
@@ -71,7 +71,7 @@ type TI m = StateT WriterState m
-- | Convert Pandoc to Texinfo.
writeTexinfo :: PandocMonad m => WriterOptions -> Pandoc -> m Text
writeTexinfo options document =
- evalStateT (pandocToTexinfo options $ wrapTop document) $
+ evalStateT (pandocToTexinfo options $ wrapTop document)
WriterState { stStrikeout = False, stSuperscript = False,
stEscapeComma = False, stSubscript = False,
stIdentifiers = Set.empty, stOptions = options}
@@ -102,8 +102,8 @@ pandocToTexinfo options (Pandoc meta blocks) = do
$ defField "titlepage" titlePage
$ defField "subscript" (stSubscript st)
$ defField "superscript" (stSuperscript st)
- $ defField "strikeout" (stStrikeout st)
- $ metadata
+ $
+ defField "strikeout" (stStrikeout st) metadata
case writerTemplate options of
Nothing -> return body
Just tpl -> renderTemplate' tpl context
@@ -166,11 +166,11 @@ blockToTexinfo (BlockQuote lst) = do
contents $$
text "@end quotation"
-blockToTexinfo (CodeBlock _ str) = do
+blockToTexinfo (CodeBlock _ str) =
return $ blankline $$
- text "@verbatim" $$
- flush (text str) $$
- text "@end verbatim" <> blankline
+ text "@verbatim" $$
+ flush (text str) $$
+ text "@end verbatim" <> blankline
blockToTexinfo b@(RawBlock f str)
| f == "texinfo" = return $ text str
@@ -218,7 +218,7 @@ blockToTexinfo HorizontalRule =
text "@bigskip@hrule@bigskip" $$
text "@end iftex" $$
text "@ifnottex" $$
- text (take 72 $ repeat '-') $$
+ text (replicate 72 '-') $$
text "@end ifnottex"
blockToTexinfo (Header 0 _ lst) = do
@@ -339,7 +339,7 @@ blockListToTexinfo (x:xs) = do
Para _ -> do
xs' <- blockListToTexinfo xs
case xs of
- ((CodeBlock _ _):_) -> return $ x' $$ xs'
+ (CodeBlock _ _:_) -> return $ x' $$ xs'
_ -> return $ x' $+$ xs'
_ -> do
xs' <- blockListToTexinfo xs
@@ -437,7 +437,7 @@ inlineToTexinfo (Subscript lst) = do
inlineToTexinfo (SmallCaps lst) =
inlineListToTexinfo lst >>= return . inCmd "sc"
-inlineToTexinfo (Code _ str) = do
+inlineToTexinfo (Code _ str) =
return $ text $ "@code{" ++ stringToTexinfo str ++ "}"
inlineToTexinfo (Quoted SingleQuote lst) = do
@@ -459,7 +459,7 @@ inlineToTexinfo il@(RawInline f str)
| otherwise = do
report $ InlineNotRendered il
return empty
-inlineToTexinfo (LineBreak) = return $ text "@*" <> cr
+inlineToTexinfo LineBreak = return $ text "@*" <> cr
inlineToTexinfo SoftBreak = do
wrapText <- gets (writerWrapText . stOptions)
case wrapText of
@@ -472,7 +472,7 @@ inlineToTexinfo (Link _ txt (src@('#':_), _)) = do
contents <- escapeCommas $ inlineListToTexinfo txt
return $ text "@ref" <>
braces (text (stringToTexinfo src) <> text "," <> contents)
-inlineToTexinfo (Link _ txt (src, _)) = do
+inlineToTexinfo (Link _ txt (src, _)) =
case txt of
[Str x] | escapeURI x == src -> -- autolink
do return $ text $ "@url{" ++ x ++ "}"
@@ -484,7 +484,7 @@ inlineToTexinfo (Link _ txt (src, _)) = do
inlineToTexinfo (Image attr alternate (source, _)) = do
content <- escapeCommas $ inlineListToTexinfo alternate
opts <- gets stOptions
- let showDim dim = case (dimension dim attr) of
+ let showDim dim = case dimension dim attr of
(Just (Pixel a)) -> showInInch opts (Pixel a) ++ "in"
(Just (Percent _)) -> ""
(Just d) -> show d