@@ -349,6 +349,8 @@ writeDocx opts doc@(Pandoc meta _) = do
349 "application/vnd.openxmlformats-officedocument.extended-properties+xml")
349 "application/vnd.openxmlformats-officedocument.extended-properties+xml")
350 ,("/docProps/core.xml",
350 ,("/docProps/core.xml",
351 "application/vnd.openxmlformats-package.core-properties+xml")
351 "application/vnd.openxmlformats-package.core-properties+xml")
352+ ,("/docProps/custom.xml",
353+ "application/vnd.openxmlformats-officedocument.custom-properties+xml")
352 ,("/word/styles.xml",
354 ,("/word/styles.xml",
353 "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml")
355 "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml")
354 ,("/word/document.xml",
356 ,("/word/document.xml",
@@ -507,6 +509,19 @@ writeDocx opts doc@(Pandoc meta _) = do
507 ]) (formatTime defaultTimeLocale "%FT%XZ" utctime)
509 ]) (formatTime defaultTimeLocale "%FT%XZ" utctime)
508 let docPropsEntry = toEntry docPropsPath epochtime $ renderXml docProps
510 let docPropsEntry = toEntry docPropsPath epochtime $ renderXml docProps
512+ let customProperties :: [(String, String)]
513+ customProperties = [] -- FIXME
514+ let mkCustomProp (k, v) pid = mknode "property"
515+ [("fmtid","{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
517+ ,("name", k)] $ mknode "vt:lpwstr" [] v
518+ let customPropsPath = "docProps/custom.xml"
519+ let customProps = mknode "Properties"
520+ [("xmlns","http://schemas.openxmlformats.org/officeDocument/2006/custom-properties")
521+ ,("xmlns:vt","http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes")
522+ ] $ zipWith mkCustomProp customProperties [(2 :: Int)..]
523+ let customPropsEntry = toEntry customPropsPath epochtime $ renderXml customProps
510 let relsPath = "_rels/.rels"
525 let relsPath = "_rels/.rels"
511 let rels = mknode "Relationships" [("xmlns", "http://schemas.openxmlformats.org/package/2006/relationships")]
526 let rels = mknode "Relationships" [("xmlns", "http://schemas.openxmlformats.org/package/2006/relationships")]
512 $ map (\attrs -> mknode "Relationship" attrs ())
527 $ map (\attrs -> mknode "Relationship" attrs ())
@@ -519,6 +534,9 @@ writeDocx opts doc@(Pandoc meta _) = do
519 , [("Id","rId3")
534 , [("Id","rId3")
520 ,("Type","http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties")
535 ,("Type","http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties")
521 ,("Target","docProps/core.xml")]
536 ,("Target","docProps/core.xml")]
538+ ,("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties")
539+ ,("Target","docProps/custom.xml")]
523 let relsEntry = toEntry relsPath epochtime $ renderXml rels
541 let relsEntry = toEntry relsPath epochtime $ renderXml rels
@@ -558,7 +576,8 @@ writeDocx opts doc@(Pandoc meta _) = do
558 contentTypesEntry : relsEntry : contentEntry : relEntry :
576 contentTypesEntry : relsEntry : contentEntry : relEntry :
559 footnoteRelEntry : numEntry : styleEntry : footnotesEntry :
577 footnoteRelEntry : numEntry : styleEntry : footnotesEntry :
560 commentsEntry :
578 commentsEntry :
561− docPropsEntry : docPropsAppEntry : themeEntry :
579+ docPropsEntry : docPropsAppEntry : customPropsEntry :
562 fontTableEntry : settingsEntry : webSettingsEntry :
581 fontTableEntry : settingsEntry : webSettingsEntry :
563 imageEntries ++ headerFooterEntries ++
582 imageEntries ++ headerFooterEntries ++
564 miscRelEntries ++ otherMediaEntries
583 miscRelEntries ++ otherMediaEntries