git.iko.soy/typeable/pandoc
on master help sign in
Use $for$ for multiple authors in context, latex, markdown.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1723 788f1e2b-df1e-0410-8736-df70ead52e1b

commitdd210437f6abab19512c387ac73af1e3e44aa5ae authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateThu 31 Dec 2009, 01:16 (17 years ago) parentfbef848
6 files changed+11−16
src/Text/Pandoc/Writers/ConTeXt.hs+2−2 src/Text/Pandoc/Writers/LaTeX.hs+3−3 src/Text/Pandoc/Writers/Markdown.hs+3−4 templates/context.template+1−3 templates/latex.template+1−3 templates/markdown.template+1−1
src/Text/Pandoc/Writers/ConTeXt.hs+2−2
@@ -76,8 +76,8 @@ pandocToConTeXt options (Pandoc (Meta title authors date) blocks) = do
7676 [ ("toc", if writerTableOfContents options then "yes" else "")
7777 , ("body", main)
7878 , ("title", titletext)
79− , ("authors", intercalate "\\\\" authorstext)
80− , ("date", datetext) ]
79+ , ("date", datetext) ] ++
80+ [ ("author", a) | a <- authorstext ]
8181 return $ if writerStandalone options
8282 then renderTemplate context $ writerTemplate options
8383 else main
src/Text/Pandoc/Writers/LaTeX.hs+3−3
@@ -32,7 +32,7 @@ import Text.Pandoc.Definition
3232import Text.Pandoc.Shared
3333import Text.Pandoc.Templates
3434import Text.Printf ( printf )
35−import Data.List ( (\\), isSuffixOf, intercalate, intersperse )
35+import Data.List ( (\\), isSuffixOf, intersperse )
3636import Data.Char ( toLower )
3737import Control.Monad.State
3838import Control.Monad (liftM)
@@ -67,8 +67,8 @@ pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do
6767 [ ("toc", if writerTableOfContents options then "yes" else "")
6868 , ("body", main)
6969 , ("title", titletext)
70− , ("authors", intercalate "\\\\" authorsText)
71− , ("date", dateText) ]
70+ , ("date", dateText) ] ++
71+ [ ("author", a) | a <- authorsText ]
7272 return $ if writerStandalone options
7373 then renderTemplate context $ writerTemplate options
7474 else main
src/Text/Pandoc/Writers/Markdown.hs+3−4
@@ -52,8 +52,7 @@ writeMarkdown opts document =
5252pandocToMarkdown :: WriterOptions -> Pandoc -> State WriterState String
5353pandocToMarkdown opts (Pandoc (Meta title authors date) blocks) = do
5454 title' <- inlineListToMarkdown opts title
55− authors' <- liftM (hcat . intersperse (text "; ")) $
56− mapM (inlineListToMarkdown opts) authors
55+ authors' <- mapM (inlineListToMarkdown opts) authors
5756 date' <- inlineListToMarkdown opts date
5857 let titleblock = not $ null title && null authors && null date
5958 let headerBlocks = filter isHeaderBlock blocks
@@ -76,10 +75,10 @@ pandocToMarkdown opts (Pandoc (Meta title authors date) blocks) = do
7675 [ ("toc", render toc)
7776 , ("body", main)
7877 , ("title", render title')
79− , ("authors", render authors')
8078 , ("date", render date')
8179 ] ++
82− [ ("titleblock", "yes") | titleblock ]
80+ [ ("titleblock", "yes") | titleblock ] ++
81+ [ ("author", render a) | a <- authors' ]
8382 if writerStandalone opts
8483 then return $ renderTemplate context $ writerTemplate opts
8584 else return main
templates/context.template+1−3
@@ -78,9 +78,7 @@ $endfor$
7878$if(title)$
7979\doctitle{$title$}
8080$endif$
81−$if(authors)$
82−\author{$authors$}
83−$endif$
81+\author{$for(author)$$author$$sep$\\$endfor$}
8482$if(date)$
8583\date{$date$}
8684$endif$
templates/latex.template+1−3
@@ -38,9 +38,7 @@ $endfor$
3838$if(title)$
3939\title{$title$}
4040$endif$
41−$if(authors)$
42−\author{$authors$}
43−$endif$
41+\author{$for(author)$$author$$sep$\\$endfor$}
4442$if(date)$
4543\date{$date$}
4644$endif$
templates/markdown.template+1−1
@@ -1,6 +1,6 @@
11$if(titleblock)$
22% $title$
3−% $authors$
3+% $for(author)$$author$$sep$; $endfor$
44% $date$
55
66$endif$