@@ -349,6 +349,8 @@ writeDocx opts doc@(Pandoc meta _) = do
349349 "application/vnd.openxmlformats-officedocument.extended-properties+xml")
350350 ,("/docProps/core.xml",
351351 "application/vnd.openxmlformats-package.core-properties+xml")
352+ ,("/docProps/custom.xml",
353+ "application/vnd.openxmlformats-officedocument.custom-properties+xml")
352354 ,("/word/styles.xml",
353355 "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml")
354356 ,("/word/document.xml",
@@ -507,6 +509,19 @@ writeDocx opts doc@(Pandoc meta _) = do
507509 ]) (formatTime defaultTimeLocale "%FT%XZ" utctime)
508510 let docPropsEntry = toEntry docPropsPath epochtime $ renderXml docProps
509511
512+ let customProperties :: [(String, String)]
513+ customProperties = [] -- FIXME
514+ let mkCustomProp (k, v) pid = mknode "property"
515+ [("fmtid","{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
516+ ,("pid", show pid)
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
524+
510525 let relsPath = "_rels/.rels"
511526 let rels = mknode "Relationships" [("xmlns", "http://schemas.openxmlformats.org/package/2006/relationships")]
512527 $ map (\attrs -> mknode "Relationship" attrs ())
@@ -519,6 +534,9 @@ writeDocx opts doc@(Pandoc meta _) = do
519534 , [("Id","rId3")
520535 ,("Type","http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties")
521536 ,("Target","docProps/core.xml")]
537+ , [("Id","rId5")
538+ ,("Type","http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties")
539+ ,("Target","docProps/custom.xml")]
522540 ]
523541 let relsEntry = toEntry relsPath epochtime $ renderXml rels
524542
@@ -558,7 +576,8 @@ writeDocx opts doc@(Pandoc meta _) = do
558576 contentTypesEntry : relsEntry : contentEntry : relEntry :
559577 footnoteRelEntry : numEntry : styleEntry : footnotesEntry :
560578 commentsEntry :
561− docPropsEntry : docPropsAppEntry : themeEntry :
579+ docPropsEntry : docPropsAppEntry : customPropsEntry :
580+ themeEntry :
562581 fontTableEntry : settingsEntry : webSettingsEntry :
563582 imageEntries ++ headerFooterEntries ++
564583 miscRelEntries ++ otherMediaEntries