git.iko.soy/typeable/pandoc
on master help sign in
Man writer:
4fe56a8fiddlosopher
man/man1/hsmarkdown.1.md+1−1
@@ -1,4 +1,4 @@
1−% HSMARKDOWN
1+% HSMARKDOWN | 1
2% John MacFarlane
2% John MacFarlane
3% June 30, 2007
3% June 30, 2007
4
4
man/man1/html2markdown.1.md+1−1
@@ -1,4 +1,4 @@
1−% HTML2MARKDOWN
1+% HTML2MARKDOWN | 1
2% John MacFarlane and Recai Oktas
2% John MacFarlane and Recai Oktas
3% June 30, 2007
3% June 30, 2007
4
4
man/man1/markdown2pdf.1.md+1−1
@@ -1,4 +1,4 @@
1−% MARKDOWN2PDF
1+% MARKDOWN2PDF | 1
2% John MacFarlane and Recai Oktas
2% John MacFarlane and Recai Oktas
3% June 30, 2007
3% June 30, 2007
4
4
man/man1/pandoc.1.md+1−1
@@ -1,4 +1,4 @@
1−% PANDOC
1+% PANDOC | 1
2% John MacFarlane
2% John MacFarlane
3% June 30, 2007
3% June 30, 2007
4
4
src/Text/Pandoc/Writers/Man.hs+9−3
@@ -69,9 +69,15 @@ metaToMan :: WriterOptions -- ^ Options, including Man header
69 -> Meta -- ^ Meta with bibliographic information
69 -> Meta -- ^ Meta with bibliographic information
70 -> State WriterState (Doc, Doc)
70 -> State WriterState (Doc, Doc)
71metaToMan options (Meta title authors date) = do
71metaToMan options (Meta title authors date) = do
72− title' <- inlineListToMan options title
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)
73− let head = (text ".TH \"") <> title' <> text ("\" 1 \"" ++ date ++
79+ let head = (text ".TH") <+> title' <+> section <+>
74− "\" \"") <> title' <> text ("\" \"User Manuals\"")
80+ doubleQuotes (text date) <+> hsep rest
75 let foot = case length authors of
81 let foot = case length authors of
76 0 -> text $ ""
82 0 -> text $ ""
77 1 -> text $ ".SH AUTHOR\n" ++ joinWithSep ", " authors
83 1 -> text $ ".SH AUTHOR\n" ++ joinWithSep ", " authors