aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Man.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Writers/Man.hs')
-rw-r--r--src/Text/Pandoc/Writers/Man.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs
index ed8682a84..506461fac 100644
--- a/src/Text/Pandoc/Writers/Man.hs
+++ b/src/Text/Pandoc/Writers/Man.hs
@@ -26,6 +26,7 @@ import Text.Pandoc.Logging
import Text.Pandoc.Options
import Text.Pandoc.Pretty
import Text.Pandoc.Shared
+import Text.Pandoc.Walk (walk)
import Text.Pandoc.Templates
import Text.Pandoc.Writers.Math
import Text.Pandoc.Writers.Shared
@@ -228,7 +229,9 @@ definitionListItemToMan :: PandocMonad m
-> ([Inline],[[Block]])
-> StateT WriterState m Doc
definitionListItemToMan opts (label, defs) = do
- labelText <- inlineListToMan opts label
+ -- in most man pages, option and other code in option lists is boldface,
+ -- but not other things, so we try to reproduce this style:
+ labelText <- inlineListToMan opts $ makeCodeBold label
contents <- if null defs
then return empty
else liftM vcat $ forM defs $ \blocks ->
@@ -245,7 +248,12 @@ definitionListItemToMan opts (label, defs) = do
then empty
else text ".RS" $$ rest' $$ text ".RE"
[] -> return empty
- return $ text ".TP" $$ nowrap (text ".B " <> labelText) $$ contents
+ return $ text ".TP" $$ nowrap labelText $$ contents
+
+makeCodeBold :: [Inline] -> [Inline]
+makeCodeBold = walk go
+ where go x@(Code{}) = Strong [x]
+ go x = x
-- | Convert list of Pandoc block elements to man.
blockListToMan :: PandocMonad m