git.iko.soy/typeable/pandoc
on master help sign in
Use separate variables for meta-date, meta-author.
6eb6a99John MacFarlane
src/Text/Pandoc/Writers/HTML.hs+8−7
@@ -160,16 +160,16 @@ inTemplate :: TemplateTarget a
160 -> [(String,String)]
160 -> [(String,String)]
161 -> a
161 -> a
162inTemplate opts tit auths date toc body' newvars =
162inTemplate opts tit auths date toc body' newvars =
163− let renderedTit = showHtmlFragment tit
163+ let title' = dropWhile (=='\n') $ showHtmlFragment tit
164− topTitle' = stripTags renderedTit
165− authors = map (stripTags . showHtmlFragment) auths
164+ authors = map showHtmlFragment auths
166− date' = stripTags $ showHtmlFragment date
165+ date' = showHtmlFragment date
167 variables = writerVariables opts ++ newvars
166 variables = writerVariables opts ++ newvars
168 context = variables ++
167 context = variables ++
169 [ ("body", dropWhile (=='\n') $ showHtmlFragment body')
168 [ ("body", dropWhile (=='\n') $ showHtmlFragment body')
170− , ("pagetitle", topTitle')
169+ , ("pagetitle", stripTags title')
171− , ("title", dropWhile (=='\n') $ showHtmlFragment tit)
170+ , ("title", title')
172 , ("date", date')
171 , ("date", date')
172+ , ("date-meta", stripTags date')
173 , ("idprefix", writerIdentifierPrefix opts)
173 , ("idprefix", writerIdentifierPrefix opts)
174 , ("slidy-url", "http://www.w3.org/Talks/Tools/Slidy2")
174 , ("slidy-url", "http://www.w3.org/Talks/Tools/Slidy2")
175 , ("s5-url", "s5/default") ] ++
175 , ("s5-url", "s5/default") ] ++
@@ -177,7 +177,8 @@ inTemplate opts tit auths date toc body' newvars =
177 (case toc of
177 (case toc of
178 Just t -> [ ("toc", showHtmlFragment t)]
178 Just t -> [ ("toc", showHtmlFragment t)]
179 Nothing -> []) ++
179 Nothing -> []) ++
180− [ ("author", a) | a <- authors ]
180+ [ ("author", a) | a <- authors ] ++
181+ [ ("author-meta", stripTags a) | a <- authors ]
181 in renderTemplate context $ writerTemplate opts
182 in renderTemplate context $ writerTemplate opts
182
183
183-- | Like Text.XHtml's identifier, but adds the writerIdentifierPrefix
184-- | Like Text.XHtml's identifier, but adds the writerIdentifierPrefix
templates+1−1

Submodule changed.