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 e13f46af9..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 <- withFontFeature 'B' (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" $$ 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