aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-07-14 10:52:06 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2010-07-14 10:58:34 -0700
commit8757da76b0e4c26f722ac4742689739b2b5dfb08 (patch)
treeaed05f3f9bfccb6e22291ff6471612c72f9389df /src/Text/Pandoc/Writers
parent1436437683c3b536eea2affe746dc353893222f8 (diff)
downloadpandoc-8757da76b0e4c26f722ac4742689739b2b5dfb08.tar.gz
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.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Man.hs10
1 files changed, 7 insertions, 3 deletions
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