aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs7
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs4
2 files changed, 6 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index fb05c18a3..218a6e42a 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -97,7 +97,7 @@ writeDocx :: Maybe FilePath -- ^ Path specified by --reference-docx
-> WriterOptions -- ^ Writer options
-> Pandoc -- ^ Document to convert
-> IO B.ByteString
-writeDocx mbRefDocx opts doc@(Pandoc (Meta tit auths _) _) = do
+writeDocx mbRefDocx opts doc@(Pandoc (Meta tit auths date) _) = do
let datadir = writerUserDataDir opts
refArchive <- liftM toArchive $
case mbRefDocx of
@@ -161,7 +161,8 @@ writeDocx mbRefDocx opts doc@(Pandoc (Meta tit auths _) _) = do
,("xmlns:dcmitype","http://purl.org/dc/dcmitype/")
,("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance")]
$ mknode "dc:title" [] (stringify tit)
- : mknode "dcterms:created" [("xsi:type","dcterms:W3CDTF")] () -- put doc date here
+ : mknode "dcterms:created" [("xsi:type","dcterms:W3CDTF")]
+ (maybe "" id $ normalizeDate $ stringify date)
: mknode "dcterms:modified" [("xsi:type","dcterms:W3CDTF")] () -- put current time here
: map (mknode "dc:creator" [] . stringify) auths
let docPropsEntry = toEntry docPropsPath epochtime $ fromString $ showTopElement' docProps
@@ -653,4 +654,4 @@ inlineToOpenXML opts (Image alt (src, tit)) = do
else do
liftIO $ UTF8.hPutStrLn stderr $
"Could not find image `" ++ src ++ "', skipping..."
- inlinesToOpenXML opts alt \ No newline at end of file
+ inlinesToOpenXML opts alt
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 5530247a2..8ca7aca62 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -182,13 +182,13 @@ inTemplate :: TemplateTarget a
inTemplate opts tit auths authsMeta date toc body' newvars =
let title' = renderHtml tit
date' = renderHtml date
+ dateMeta = maybe [] (\x -> [("date-meta",x)]) $ normalizeDate date'
variables = writerVariables opts ++ newvars
- context = variables ++
+ context = variables ++ dateMeta ++
[ ("body", dropWhile (=='\n') $ renderHtml body')
, ("pagetitle", stripTags title')
, ("title", title')
, ("date", date')
- , ("date-meta", stripTags date')
, ("idprefix", writerIdentifierPrefix opts)
, ("slidy-url", "http://www.w3.org/Talks/Tools/Slidy2")
, ("s5-url", "s5/default") ] ++