git.iko.soy/typeable/pandoc
on master help sign in
Man writer:

- Added scheme for specifying manual section and additional headers: % PROGNAM | 1 | User Manual | Version 4.0 - Modified man page sources to include section 1 git-svn-id: https://pandoc.googlecode.com/svn/trunk@619 788f1e2b-df1e-0410-8736-df70ead52e1b

commit4fe56a8d18f49125a36f0c229548a23d5bbe0d13 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateWed 4 Jul 2007, 15:53 (19 years ago) parentd5c47c3
5 files changed+13−7
man/man1/hsmarkdown.1.md+1−1 man/man1/html2markdown.1.md+1−1 man/man1/markdown2pdf.1.md+1−1 man/man1/pandoc.1.md+1−1 src/Text/Pandoc/Writers/Man.hs+9−3
man/man1/hsmarkdown.1.md+1−1
@@ -1,4 +1,4 @@
1−% HSMARKDOWN
1+% HSMARKDOWN | 1
22% John MacFarlane
33% June 30, 2007
44
man/man1/html2markdown.1.md+1−1
@@ -1,4 +1,4 @@
1−% HTML2MARKDOWN
1+% HTML2MARKDOWN | 1
22% John MacFarlane and Recai Oktas
33% June 30, 2007
44
man/man1/markdown2pdf.1.md+1−1
@@ -1,4 +1,4 @@
1−% MARKDOWN2PDF
1+% MARKDOWN2PDF | 1
22% John MacFarlane and Recai Oktas
33% June 30, 2007
44
man/man1/pandoc.1.md+1−1
@@ -1,4 +1,4 @@
1−% PANDOC
1+% PANDOC | 1
22% John MacFarlane
33% June 30, 2007
44
src/Text/Pandoc/Writers/Man.hs+9−3
@@ -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