From 8757da76b0e4c26f722ac4742689739b2b5dfb08 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 14 Jul 2010 10:52:06 -0700 Subject: Improved handling of code in man writer. + Inline code is now in monoscpace, not bold. + Code blocks now use .nf (no fill) and .IP (indented paragraph). + Resolves Issue #247. --- src/Text/Pandoc/Writers/Man.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index c74cd81f9..45e7e5083 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -151,8 +151,12 @@ blockToMan opts (Header level inlines) = do _ -> ".SS " return $ text heading <> contents blockToMan _ (CodeBlock _ str) = return $ - text ".PP" $$ text "\\f[CR]" $$ - text ((unlines . map (" " ++) . lines) (escapeCode str)) <> text "\\f[]" + text ".IP" $$ + text ".nf" $$ + text "\\f[C]" $$ + text (escapeCode str) $$ + text "\\f[]" $$ + text ".fi" blockToMan opts (BlockQuote blocks) = do contents <- blockListToMan opts blocks return $ text ".RS" $$ contents $$ text ".RE" @@ -300,7 +304,7 @@ inlineToMan _ EnDash = return $ text "\\[en]" inlineToMan _ Apostrophe = return $ char '\'' inlineToMan _ Ellipses = return $ text "\\&..." inlineToMan _ (Code str) = - return $ text $ "\\f[B]" ++ escapeCode str ++ "\\f[]" + return $ text $ "\\f[C]" ++ escapeCode str ++ "\\f[]" inlineToMan _ (Str str) = return $ text $ escapeString str inlineToMan opts (Math InlineMath str) = inlineListToMan opts $ readTeXMath str inlineToMan opts (Math DisplayMath str) = do -- cgit v1.2.3