@@ -69,9 +69,15 @@ metaToMan :: WriterOptions -- ^ Options, including Man header
6969 -> Meta -- ^ Meta with bibliographic information
7070 -> State WriterState (Doc, Doc)
7171metaToMan options (Meta title authors date) = do
72− title' <- inlineListToMan options title
73− let head = (text ".TH \"") <> title' <> text ("\" 1 \"" ++ date ++
74− "\" \"") <> title' <> text ("\" \"User Manuals\"")
72+ titleParts <- mapM (inlineListToMan options) $ map normalizeSpaces $
73+ splitBy (Str "|") title
74+ let titleParts' = map doubleQuotes titleParts
75+ let (title', section, rest) = case titleParts' of
76+ [] -> (text "\"\"", text "\"\"", [])
77+ [x] -> (x, text "\"\"", [])
78+ (x:y:zs) -> (x, y, zs)
79+ let head = (text ".TH") <+> title' <+> section <+>
80+ doubleQuotes (text date) <+> hsep rest
7581 let foot = case length authors of
7682 0 -> text $ ""
7783 1 -> text $ ".SH AUTHOR\n" ++ joinWithSep ", " authors