summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-04 15:53:49 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-04 15:53:49 +0000
commit4fe56a8d18f49125a36f0c229548a23d5bbe0d13 (patch)
treeade32a355feeb0920055ff6489225f02cad8a368
parentd5c47c33cabfc3d8b90c6ef0b7a5a90ec1745d08 (diff)
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
-rw-r--r--man/man1/hsmarkdown.1.md2
-rw-r--r--man/man1/html2markdown.1.md2
-rw-r--r--man/man1/markdown2pdf.1.md2
-rw-r--r--man/man1/pandoc.1.md2
-rw-r--r--src/Text/Pandoc/Writers/Man.hs12
5 files changed, 13 insertions, 7 deletions
diff --git a/man/man1/hsmarkdown.1.md b/man/man1/hsmarkdown.1.md
index 54d14a3ad..46b5bd685 100644
--- a/man/man1/hsmarkdown.1.md
+++ b/man/man1/hsmarkdown.1.md
@@ -1,4 +1,4 @@
-% HSMARKDOWN
+% HSMARKDOWN | 1
% John MacFarlane
% June 30, 2007
diff --git a/man/man1/html2markdown.1.md b/man/man1/html2markdown.1.md
index 47757599a..8c4bf1baf 100644
--- a/man/man1/html2markdown.1.md
+++ b/man/man1/html2markdown.1.md
@@ -1,4 +1,4 @@
-% HTML2MARKDOWN
+% HTML2MARKDOWN | 1
% John MacFarlane and Recai Oktas
% June 30, 2007
diff --git a/man/man1/markdown2pdf.1.md b/man/man1/markdown2pdf.1.md
index 1e6439f58..15238f93c 100644
--- a/man/man1/markdown2pdf.1.md
+++ b/man/man1/markdown2pdf.1.md
@@ -1,4 +1,4 @@
-% MARKDOWN2PDF
+% MARKDOWN2PDF | 1
% John MacFarlane and Recai Oktas
% June 30, 2007
diff --git a/man/man1/pandoc.1.md b/man/man1/pandoc.1.md
index edc999dae..9cda839c3 100644
--- a/man/man1/pandoc.1.md
+++ b/man/man1/pandoc.1.md
@@ -1,4 +1,4 @@
-% PANDOC
+% PANDOC | 1
% John MacFarlane
% June 30, 2007
diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs
index 23728a77e..2c3fc00bd 100644
--- a/src/Text/Pandoc/Writers/Man.hs
+++ b/src/Text/Pandoc/Writers/Man.hs
@@ -69,9 +69,15 @@ metaToMan :: WriterOptions -- ^ Options, including Man header
-> Meta -- ^ Meta with bibliographic information
-> State WriterState (Doc, Doc)
metaToMan options (Meta title authors date) = do
- title' <- inlineListToMan options title
- let head = (text ".TH \"") <> title' <> text ("\" 1 \"" ++ date ++
- "\" \"") <> title' <> text ("\" \"User Manuals\"")
+ titleParts <- mapM (inlineListToMan options) $ map normalizeSpaces $
+ splitBy (Str "|") title
+ let titleParts' = map doubleQuotes titleParts
+ let (title', section, rest) = case titleParts' of
+ [] -> (text "\"\"", text "\"\"", [])
+ [x] -> (x, text "\"\"", [])
+ (x:y:zs) -> (x, y, zs)
+ let head = (text ".TH") <+> title' <+> section <+>
+ doubleQuotes (text date) <+> hsep rest
let foot = case length authors of
0 -> text $ ""
1 -> text $ ".SH AUTHOR\n" ++ joinWithSep ", " authors