diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2014-06-03 13:14:32 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2014-06-03 13:14:32 -0700 |
commit | 0ddb4cd2e8883c226ca7ab8a92737dc29f07dfda (patch) | |
tree | 2116ab54dddf78dc9d58943567b77361cce239a5 /src | |
parent | ec047aaa8c1c1e9d69b0029a2e4512785fbc15a8 (diff) | |
download | pandoc-0ddb4cd2e8883c226ca7ab8a92737dc29f07dfda.tar.gz |
Docx writer: Combine reference.docx numbering with pandoc's.
This should have fixed #1305, allowing the reference.docx to define
section numbering, but it doesn't. Now the headings appear with proper
indentation, but the numbers don't appear. Unclear why. styles.xml and
numbering.xml basically match the docx which has the expected result.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/Docx.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index 3d2f5d4b5..785238d6f 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -289,8 +289,10 @@ writeDocx opts doc@(Pandoc meta _) = do -- construct word/numbering.xml let numpath = "word/numbering.xml" - numEntry <- (toEntry numpath epochtime . renderXml) - `fmap` mkNumbering (stLists st) + numbering <- parseXml refArchive distArchive numpath + newNumElts <- mkNumbering (stLists st) + let numEntry = toEntry numpath epochtime $ renderXml numbering{ elContent = + elContent numbering ++ map Elem newNumElts } let docPropsPath = "docProps/core.xml" let docProps = mknode "cp:coreProperties" [("xmlns:cp","http://schemas.openxmlformats.org/package/2006/metadata/core-properties") @@ -392,12 +394,10 @@ styleToOpenXml style = parStyle : map toStyle alltoktypes baseListId :: Int baseListId = 1000 -mkNumbering :: [ListMarker] -> IO Element +mkNumbering :: [ListMarker] -> IO [Element] mkNumbering lists = do elts <- mapM mkAbstractNum (ordNub lists) - return $ mknode "w:numbering" - [("xmlns:w","http://schemas.openxmlformats.org/wordprocessingml/2006/main")] - $ elts ++ zipWith mkNum lists [baseListId..(baseListId + length lists - 1)] + return $ elts ++ zipWith mkNum lists [baseListId..(baseListId + length lists - 1)] mkNum :: ListMarker -> Int -> Element mkNum marker numid = |