git.iko.soy/typeable/pandoc
on master help sign in
Use $for$ for --css option in HTML writer.

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

commit7baa79597e1306eeed0313ffafd240b4df5080bb authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateThu 31 Dec 2009, 01:15 (17 years ago) parent5ba6c09
3 files changed+10−12
src/Text/Pandoc/Writers/HTML.hs+3−3 src/pandoc.hs+1−8 templates/html.template+6−1
src/Text/Pandoc/Writers/HTML.hs+3−3
@@ -38,7 +38,7 @@ import Text.Pandoc.Highlighting ( highlightHtml )
3838import Text.Pandoc.XML (stripTags)
3939import Numeric ( showHex )
4040import Data.Char ( ord, toLower )
41−import Data.List ( isPrefixOf, intersperse, intercalate )
41+import Data.List ( isPrefixOf, intersperse )
4242import Data.Maybe ( catMaybes )
4343import Control.Monad.State
4444import Text.XHtml.Transitional hiding ( stringToHtml )
@@ -155,8 +155,8 @@ inTemplate opts tit auths date toc body' newvars =
155155 , ("pagetitle", topTitle')
156156 , ("toc", renderHtmlFragment toc)
157157 , ("title", renderHtmlFragment tit)
158− , ("authors", intercalate "; " authors)
159− , ("date", date') ]
158+ , ("date", date') ] ++
159+ [ ("author", a) | a <- authors ]
160160 in renderTemplate context $ writerTemplate opts
161161
162162-- | Like Text.XHtml's identifier, but adds the writerIdentifierPrefix
src/pandoc.hs+1−8
@@ -358,14 +358,7 @@ options =
358358 , Option "c" ["css"]
359359 (ReqArg
360360 (\arg opt -> do
361− let text' = "<link rel=\"stylesheet\" href=\"" ++ arg ++
362− "\" type=\"text/css\" />\n"
363− let oldvars = optVariables opt
364− let newvars = case lookup "css" oldvars of
365− Nothing -> ("css", text') : oldvars
366− Just b -> ("css", b ++ text') :
367− filter ((/= "css") . fst)
368− oldvars
361+ let newvars = ("css",arg) : optVariables opt
369362 return opt { optVariables = newvars,
370363 optStandalone = True })
371364 "URL")
templates/html.template+6−1
@@ -4,7 +4,9 @@
44 <title>$if(title-prefix)$$title-prefix$ - $endif$$if(pagetitle)$$pagetitle$$endif$</title>
55 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
66 <meta name="generator" content="pandoc" />
7− <meta name="author" content="$authors$" />
7+$for(author)$
8+ <meta name="author" content="$author$" />
9+$endfor$
810 <meta name="date" content="$date$" />
911$if(highlighting)$
1012 <style type="text/css">
@@ -28,6 +30,9 @@ $if(highlighting)$
2830 pre.sourceCode span.Error { color: red; font-weight: bold; }
2931 </style>
3032$endif$
33+$for(css)$
34+ <link rel="stylesheet" href="$css$" type="text/css" />
35+$endfor$
3136$if(header-includes)$
3237 $header-includes$
3338$endif$