git.iko.soy/typeable/pandoc
on master help sign in
Naming: Use Docx instead of DocX.
bbe9900John MacFarlane
pandoc.cabal+4−4
@@ -293,7 +293,7 @@ Library
293 Text.Pandoc.Readers.Textile,
293 Text.Pandoc.Readers.Textile,
294 Text.Pandoc.Readers.Native,
294 Text.Pandoc.Readers.Native,
295 Text.Pandoc.Readers.Haddock,
295 Text.Pandoc.Readers.Haddock,
296− Text.Pandoc.Readers.DocX,
296+ Text.Pandoc.Readers.Docx,
297 Text.Pandoc.Writers.Native,
297 Text.Pandoc.Writers.Native,
298 Text.Pandoc.Writers.Docbook,
298 Text.Pandoc.Writers.Docbook,
299 Text.Pandoc.Writers.OPML,
299 Text.Pandoc.Writers.OPML,
@@ -324,8 +324,8 @@ Library
324 Text.Pandoc.Process
324 Text.Pandoc.Process
325 Other-Modules: Text.Pandoc.Readers.Haddock.Lex,
325 Other-Modules: Text.Pandoc.Readers.Haddock.Lex,
326 Text.Pandoc.Readers.Haddock.Parse,
326 Text.Pandoc.Readers.Haddock.Parse,
327− Text.Pandoc.Readers.DocX.Lists,
327+ Text.Pandoc.Readers.Docx.Lists,
328− Text.Pandoc.Readers.DocX.Parse,
328+ Text.Pandoc.Readers.Docx.Parse,
329 Text.Pandoc.Writers.Shared,
329 Text.Pandoc.Writers.Shared,
330 Text.Pandoc.Asciify,
330 Text.Pandoc.Asciify,
331 Text.Pandoc.MIME,
331 Text.Pandoc.MIME,
@@ -411,7 +411,7 @@ Test-Suite test-pandoc
411 Tests.Readers.Markdown
411 Tests.Readers.Markdown
412 Tests.Readers.Org
412 Tests.Readers.Org
413 Tests.Readers.RST
413 Tests.Readers.RST
414− Tests.Readers.DocX
414+ Tests.Readers.Docx
415 Tests.Writers.Native
415 Tests.Writers.Native
416 Tests.Writers.ConTeXt
416 Tests.Writers.ConTeXt
417 Tests.Writers.HTML
417 Tests.Writers.HTML
src/Text/Pandoc.hs+3−3
@@ -63,7 +63,7 @@ module Text.Pandoc
63 , writers
63 , writers
64 -- * Readers: converting /to/ Pandoc format
64 -- * Readers: converting /to/ Pandoc format
65 , Reader (..)
65 , Reader (..)
66− , readDocX
66+ , readDocx
67 , readMarkdown
67 , readMarkdown
68 , readMediaWiki
68 , readMediaWiki
69 , readRST
69 , readRST
@@ -127,7 +127,7 @@ import Text.Pandoc.Readers.HTML
127import Text.Pandoc.Readers.Textile
127import Text.Pandoc.Readers.Textile
128import Text.Pandoc.Readers.Native
128import Text.Pandoc.Readers.Native
129import Text.Pandoc.Readers.Haddock
129import Text.Pandoc.Readers.Haddock
130−import Text.Pandoc.Readers.DocX
130+import Text.Pandoc.Readers.Docx
131import Text.Pandoc.Writers.Native
131import Text.Pandoc.Writers.Native
132import Text.Pandoc.Writers.Markdown
132import Text.Pandoc.Writers.Markdown
133import Text.Pandoc.Writers.RST
133import Text.Pandoc.Writers.RST
@@ -222,7 +222,7 @@ readers = [ ("native" , StringReader $ \_ s -> return $ readNative s)
222 ,("html" , mkStringReader readHtml)
222 ,("html" , mkStringReader readHtml)
223 ,("latex" , mkStringReader readLaTeX)
223 ,("latex" , mkStringReader readLaTeX)
224 ,("haddock" , mkStringReader readHaddock)
224 ,("haddock" , mkStringReader readHaddock)
225− ,("docx" , mkBSReader readDocX)
225+ ,("docx" , mkBSReader readDocx)
226 ]
226 ]
227
227
228data Writer = PureStringWriter (WriterOptions -> Pandoc -> String)
228data Writer = PureStringWriter (WriterOptions -> Pandoc -> String)
src/Text/Pandoc/Readers/DocX.hs → src/Text/Pandoc/Readers/Docx.hsrenamed+33−33
@@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17-}
17-}
18
18
19{- |
19{- |
20− Module : Text.Pandoc.Readers.DocX
20+ Module : Text.Pandoc.Readers.Docx
21 Copyright : Copyright (C) 2014 Jesse Rosenthal
21 Copyright : Copyright (C) 2014 Jesse Rosenthal
22 License : GNU GPL, version 2 or above
22 License : GNU GPL, version 2 or above
23
23
@@ -25,11 +25,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 Stability : alpha
25 Stability : alpha
26 Portability : portable
26 Portability : portable
27
27
28−Conversion of DocX type (defined in Text.Pandoc.Readers.DocX.Parse)
28+Conversion of Docx type (defined in Text.Pandoc.Readers.Docx.Parse)
29to 'Pandoc' document. -}
29to 'Pandoc' document. -}
30
30
31{-
31{-
32−Current state of implementation of DocX entities ([x] means
32+Current state of implementation of Docx entities ([x] means
33implemented, [-] means partially implemented):
33implemented, [-] means partially implemented):
34
34
35* Blocks
35* Blocks
@@ -68,8 +68,8 @@ implemented, [-] means partially implemented):
68 - [X] Note (Footnotes and Endnotes are silently combined.)
68 - [X] Note (Footnotes and Endnotes are silently combined.)
69-}
69-}
70
70
71−module Text.Pandoc.Readers.DocX
71+module Text.Pandoc.Readers.Docx
72− ( readDocX
72+ ( readDocx
73 ) where
73 ) where
74
74
75import Codec.Archive.Zip
75import Codec.Archive.Zip
@@ -79,8 +79,8 @@ import Text.Pandoc.Builder (text, toList)
79import Text.Pandoc.Generic (bottomUp)
79import Text.Pandoc.Generic (bottomUp)
80import Text.Pandoc.MIME (getMimeType)
80import Text.Pandoc.MIME (getMimeType)
81import Text.Pandoc.UTF8 (toString)
81import Text.Pandoc.UTF8 (toString)
82−import Text.Pandoc.Readers.DocX.Parse
82+import Text.Pandoc.Readers.Docx.Parse
83−import Text.Pandoc.Readers.DocX.Lists
83+import Text.Pandoc.Readers.Docx.Lists
84import Data.Maybe (mapMaybe, isJust, fromJust)
84import Data.Maybe (mapMaybe, isJust, fromJust)
85import Data.List (delete, isPrefixOf, (\\), intersect)
85import Data.List (delete, isPrefixOf, (\\), intersect)
86import qualified Data.ByteString as BS
86import qualified Data.ByteString as BS
@@ -88,11 +88,11 @@ import qualified Data.ByteString.Lazy as B
88import Data.ByteString.Base64 (encode)
88import Data.ByteString.Base64 (encode)
89import System.FilePath (combine)
89import System.FilePath (combine)
90
90
91−readDocX :: ReaderOptions
91+readDocx :: ReaderOptions
92 -> B.ByteString
92 -> B.ByteString
93 -> Pandoc
93 -> Pandoc
94−readDocX opts bytes =
94+readDocx opts bytes =
95− case archiveToDocX (toArchive bytes) of
95+ case archiveToDocx (toArchive bytes) of
96 Just docx -> Pandoc nullMeta (docxToBlocks opts docx)
96 Just docx -> Pandoc nullMeta (docxToBlocks opts docx)
97 Nothing -> error $ "couldn't parse docx file"
97 Nothing -> error $ "couldn't parse docx file"
98
98
@@ -148,8 +148,8 @@ strNormalize (Str "" : ils) = strNormalize ils
148strNormalize ((Str s) : (Str s') : l) = strNormalize ((Str (s++s')) : l)
148strNormalize ((Str s) : (Str s') : l) = strNormalize ((Str (s++s')) : l)
149strNormalize (il:ils) = il : (strNormalize ils)
149strNormalize (il:ils) = il : (strNormalize ils)
150
150
151−runToInlines :: ReaderOptions -> DocX -> Run -> [Inline]
151+runToInlines :: ReaderOptions -> Docx -> Run -> [Inline]
152−runToInlines _ _ (Run rs runElems)
152+runToInlines _ _ (Run rs runElems)
153 | isJust (rStyle rs) && (fromJust (rStyle rs)) `elem` codeSpans =
153 | isJust (rStyle rs) && (fromJust (rStyle rs)) `elem` codeSpans =
154 case runStyleToSpanAttr rs == ("", [], []) of
154 case runStyleToSpanAttr rs == ("", [], []) of
155 True -> [Str (runElemsToString runElems)]
155 True -> [Str (runElemsToString runElems)]
@@ -157,30 +157,30 @@ runToInlines _ _ (Run rs runElems)
157 | otherwise = case runStyleToSpanAttr rs == ("", [], []) of
157 | otherwise = case runStyleToSpanAttr rs == ("", [], []) of
158 True -> concatMap runElemToInlines runElems
158 True -> concatMap runElemToInlines runElems
159 False -> [Span (runStyleToSpanAttr rs) (concatMap runElemToInlines runElems)]
159 False -> [Span (runStyleToSpanAttr rs) (concatMap runElemToInlines runElems)]
160−runToInlines opts docx@(DocX _ notes _ _ _ ) (Footnote fnId) =
160+runToInlines opts docx@(Docx _ notes _ _ _ ) (Footnote fnId) =
161 case (getFootNote fnId notes) of
161 case (getFootNote fnId notes) of
162 Just bodyParts ->
162 Just bodyParts ->
163 [Note [Div ("", ["footnote"], []) (map (bodyPartToBlock opts docx) bodyParts)]]
163 [Note [Div ("", ["footnote"], []) (map (bodyPartToBlock opts docx) bodyParts)]]
164 Nothing ->
164 Nothing ->
165 [Note [Div ("", ["footnote"], []) []]]
165 [Note [Div ("", ["footnote"], []) []]]
166−runToInlines opts docx@(DocX _ notes _ _ _) (Endnote fnId) =
166+runToInlines opts docx@(Docx _ notes _ _ _) (Endnote fnId) =
167 case (getEndNote fnId notes) of
167 case (getEndNote fnId notes) of
168 Just bodyParts ->
168 Just bodyParts ->
169 [Note [Div ("", ["endnote"], []) (map (bodyPartToBlock opts docx) bodyParts)]]
169 [Note [Div ("", ["endnote"], []) (map (bodyPartToBlock opts docx) bodyParts)]]
170 Nothing ->
170 Nothing ->
171 [Note [Div ("", ["endnote"], []) []]]
171 [Note [Div ("", ["endnote"], []) []]]
172
172
173−parPartToInlines :: ReaderOptions -> DocX -> ParPart -> [Inline]
173+parPartToInlines :: ReaderOptions -> Docx -> ParPart -> [Inline]
174parPartToInlines opts docx (PlainRun r) = runToInlines opts docx r
174parPartToInlines opts docx (PlainRun r) = runToInlines opts docx r
175parPartToInlines _ _ (BookMark _ anchor) =
175parPartToInlines _ _ (BookMark _ anchor) =
176 [Span (anchor, ["anchor"], []) []]
176 [Span (anchor, ["anchor"], []) []]
177−parPartToInlines _ (DocX _ _ _ rels _) (Drawing relid) =
177+parPartToInlines _ (Docx _ _ _ rels _) (Drawing relid) =
178 case lookupRelationship relid rels of
178 case lookupRelationship relid rels of
179 Just target -> [Image [] (combine "word" target, "")]
179 Just target -> [Image [] (combine "word" target, "")]
180 Nothing -> [Image [] ("", "")]
180 Nothing -> [Image [] ("", "")]
181parPartToInlines opts docx (InternalHyperLink anchor runs) =
181parPartToInlines opts docx (InternalHyperLink anchor runs) =
182 [Link (concatMap (runToInlines opts docx) runs) ('#' : anchor, "")]
182 [Link (concatMap (runToInlines opts docx) runs) ('#' : anchor, "")]
183−parPartToInlines opts docx@(DocX _ _ _ rels _) (ExternalHyperLink relid runs) =
183+parPartToInlines opts docx@(Docx _ _ _ rels _) (ExternalHyperLink relid runs) =
184 case lookupRelationship relid rels of
184 case lookupRelationship relid rels of
185 Just target ->
185 Just target ->
186 [Link (concatMap (runToInlines opts docx) runs) (target, "")]
186 [Link (concatMap (runToInlines opts docx) runs) (target, "")]
@@ -208,9 +208,9 @@ makeHeaderAnchors h@(Header n (_, classes, kvs) ils) =
208 False -> Header n (ident, classes, kvs) (ils \\ (x:xs))
208 False -> Header n (ident, classes, kvs) (ils \\ (x:xs))
209 _ -> h
209 _ -> h
210makeHeaderAnchors blk = blk
210makeHeaderAnchors blk = blk
211−
212
211
212+
213−parPartsToInlines :: ReaderOptions -> DocX -> [ParPart] -> [Inline]
213+parPartsToInlines :: ReaderOptions -> Docx -> [ParPart] -> [Inline]
214parPartsToInlines opts docx parparts =
214parPartsToInlines opts docx parparts =
215 --
215 --
216 -- We're going to skip data-uri's for now. It should be an option,
216 -- We're going to skip data-uri's for now. It should be an option,
@@ -222,16 +222,16 @@ parPartsToInlines opts docx parparts =
222 bottomUp spanReduce $
222 bottomUp spanReduce $
223 concatMap (parPartToInlines opts docx) parparts
223 concatMap (parPartToInlines opts docx) parparts
224
224
225−cellToBlocks :: ReaderOptions -> DocX -> Cell -> [Block]
225+cellToBlocks :: ReaderOptions -> Docx -> Cell -> [Block]
226cellToBlocks opts docx (Cell bps) = map (bodyPartToBlock opts docx) bps
226cellToBlocks opts docx (Cell bps) = map (bodyPartToBlock opts docx) bps
227
227
228−rowToBlocksList :: ReaderOptions -> DocX -> Row -> [[Block]]
228+rowToBlocksList :: ReaderOptions -> Docx -> Row -> [[Block]]
229rowToBlocksList opts docx (Row cells) = map (cellToBlocks opts docx) cells
229rowToBlocksList opts docx (Row cells) = map (cellToBlocks opts docx) cells
230
230
231−bodyPartToBlock :: ReaderOptions -> DocX -> BodyPart -> Block
231+bodyPartToBlock :: ReaderOptions -> Docx -> BodyPart -> Block
232bodyPartToBlock opts docx (Paragraph pPr parparts) =
232bodyPartToBlock opts docx (Paragraph pPr parparts) =
233 Div (parStyleToDivAttr pPr) [Para (parPartsToInlines opts docx parparts)]
233 Div (parStyleToDivAttr pPr) [Para (parPartsToInlines opts docx parparts)]
234−bodyPartToBlock opts docx@(DocX _ _ numbering _ _) (ListItem pPr numId lvl parparts) =
234+bodyPartToBlock opts docx@(Docx _ _ numbering _ _) (ListItem pPr numId lvl parparts) =
235 let
235 let
236 kvs = case lookupLevel numId lvl numbering of
236 kvs = case lookupLevel numId lvl numbering of
237 Just (_, fmt, txt, Just start) -> [ ("level", lvl)
237 Just (_, fmt, txt, Just start) -> [ ("level", lvl)
@@ -240,7 +240,7 @@ bodyPartToBlock opts docx@(DocX _ _ numbering _ _) (ListItem pPr numId lvl parpa
240 , ("text", txt)
240 , ("text", txt)
241 , ("start", (show start))
241 , ("start", (show start))
242 ]
242 ]
243−
243+
244 Just (_, fmt, txt, Nothing) -> [ ("level", lvl)
244 Just (_, fmt, txt, Nothing) -> [ ("level", lvl)
245 , ("num-id", numId)
245 , ("num-id", numId)
246 , ("format", fmt)
246 , ("format", fmt)
@@ -262,7 +262,7 @@ bodyPartToBlock opts docx (Tbl cap _ look (r:rs)) =
262 Just r' -> rowToBlocksList opts docx r'
262 Just r' -> rowToBlocksList opts docx r'
263 Nothing -> []
263 Nothing -> []
264 cells = map (rowToBlocksList opts docx) rows
264 cells = map (rowToBlocksList opts docx) rows
265−
265+
266 size = case null hdrCells of
266 size = case null hdrCells of
267 True -> length $ head cells
267 True -> length $ head cells
268 False -> length $ hdrCells
268 False -> length $ hdrCells
@@ -277,8 +277,8 @@ bodyPartToBlock opts docx (Tbl cap _ look (r:rs)) =
277 in
277 in
278 Table caption alignments widths hdrCells cells
278 Table caption alignments widths hdrCells cells
279
279
280−makeImagesSelfContained :: DocX -> Inline -> Inline
280+makeImagesSelfContained :: Docx -> Inline -> Inline
281−makeImagesSelfContained (DocX _ _ _ _ media) i@(Image alt (uri, title)) =
281+makeImagesSelfContained (Docx _ _ _ _ media) i@(Image alt (uri, title)) =
282 case lookup uri media of
282 case lookup uri media of
283 Just bs -> case getMimeType uri of
283 Just bs -> case getMimeType uri of
284 Just mime -> let data_uri =
284 Just mime -> let data_uri =
@@ -289,11 +289,11 @@ makeImagesSelfContained (DocX _ _ _ _ media) i@(Image alt (uri, title)) =
289 Nothing -> i
289 Nothing -> i
290makeImagesSelfContained _ inline = inline
290makeImagesSelfContained _ inline = inline
291
291
292−bodyToBlocks :: ReaderOptions -> DocX -> Body -> [Block]
292+bodyToBlocks :: ReaderOptions -> Docx -> Body -> [Block]
293bodyToBlocks opts docx (Body bps) =
293bodyToBlocks opts docx (Body bps) =
294 bottomUp removeEmptyPars $
294 bottomUp removeEmptyPars $
295− bottomUp strNormalize $
295+ bottomUp strNormalize $
296− bottomUp spanRemove $
296+ bottomUp spanRemove $
297 bottomUp divRemove $
297 bottomUp divRemove $
298 map (makeHeaderAnchors) $
298 map (makeHeaderAnchors) $
299 bottomUp divCorrect $
299 bottomUp divCorrect $
@@ -303,8 +303,8 @@ bodyToBlocks opts docx (Body bps) =
303 blocksToBullets $
303 blocksToBullets $
304 map (bodyPartToBlock opts docx) bps
304 map (bodyPartToBlock opts docx) bps
305
305
306−docxToBlocks :: ReaderOptions -> DocX -> [Block]
306+docxToBlocks :: ReaderOptions -> Docx -> [Block]
307−docxToBlocks opts d@(DocX (Document _ body) _ _ _ _) = bodyToBlocks opts d body
307+docxToBlocks opts d@(Docx (Document _ body) _ _ _ _) = bodyToBlocks opts d body
308
308
309spanReduce :: [Inline] -> [Inline]
309spanReduce :: [Inline] -> [Inline]
310spanReduce [] = []
310spanReduce [] = []
@@ -460,7 +460,7 @@ divRemove' blk = [blk]
460
460
461divRemove :: [Block] -> [Block]
461divRemove :: [Block] -> [Block]
462divRemove = concatMap divRemove'
462divRemove = concatMap divRemove'
463−
463+
464divCorrect' :: Block -> [Block]
464divCorrect' :: Block -> [Block]
465divCorrect' b@(Div (ident, classes, kvs) blks)
465divCorrect' b@(Div (ident, classes, kvs) blks)
466 | (not . null) (blockQuoteDivs `intersect` classes) =
466 | (not . null) (blockQuoteDivs `intersect` classes) =
src/Text/Pandoc/Readers/DocX/Lists.hs → src/Text/Pandoc/Readers/Docx/Lists.hsrenamed+3−3
@@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17-}
17-}
18
18
19{- |
19{- |
20− Module : Text.Pandoc.Readers.DocX.Lists
20+ Module : Text.Pandoc.Readers.Docx.Lists
21 Copyright : Copyright (C) 2014 Jesse Rosenthal
21 Copyright : Copyright (C) 2014 Jesse Rosenthal
22 License : GNU GPL, version 2 or above
22 License : GNU GPL, version 2 or above
23
23
@@ -25,10 +25,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 Stability : alpha
25 Stability : alpha
26 Portability : portable
26 Portability : portable
27
27
28−Functions for converting flat DocX paragraphs into nested lists.
28+Functions for converting flat docx paragraphs into nested lists.
29-}
29-}
30
30
31−module Text.Pandoc.Readers.DocX.Lists ( blocksToBullets
31+module Text.Pandoc.Readers.Docx.Lists ( blocksToBullets
32 , blocksToDefinitions) where
32 , blocksToDefinitions) where
33
33
34import Text.Pandoc.JSON
34import Text.Pandoc.JSON
src/Text/Pandoc/Readers/DocX/Parse.hs → src/Text/Pandoc/Readers/Docx/Parse.hsrenamed+8−8
@@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17-}
17-}
18
18
19{- |
19{- |
20− Module : Text.Pandoc.Readers.DocX.Parse
20+ Module : Text.Pandoc.Readers.Docx.Parse
21 Copyright : Copyright (C) 2014 Jesse Rosenthal
21 Copyright : Copyright (C) 2014 Jesse Rosenthal
22 License : GNU GPL, version 2 or above
22 License : GNU GPL, version 2 or above
23
23
@@ -25,11 +25,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 Stability : alpha
25 Stability : alpha
26 Portability : portable
26 Portability : portable
27
27
28−Conversion of DocX archive into DocX haskell type
28+Conversion of docx archive into Docx haskell type
29-}
29-}
30
30
31
31
32−module Text.Pandoc.Readers.DocX.Parse ( DocX(..)
32+module Text.Pandoc.Readers.Docx.Parse ( Docx(..)
33 , Document(..)
33 , Document(..)
34 , Body(..)
34 , Body(..)
35 , BodyPart(..)
35 , BodyPart(..)
@@ -49,7 +49,7 @@ module Text.Pandoc.Readers.DocX.Parse ( DocX(..)
49 , getEndNote
49 , getEndNote
50 , lookupLevel
50 , lookupLevel
51 , lookupRelationship
51 , lookupRelationship
52− , archiveToDocX
52+ , archiveToDocx
53 ) where
53 ) where
54import Codec.Archive.Zip
54import Codec.Archive.Zip
55import Text.XML.Light
55import Text.XML.Light
@@ -67,17 +67,17 @@ attrToNSPair _ = Nothing
67
67
68type NameSpaces = [(String, String)]
68type NameSpaces = [(String, String)]
69
69
70−data DocX = DocX Document Notes Numbering [Relationship] Media
70+data Docx = Docx Document Notes Numbering [Relationship] Media
71 deriving Show
71 deriving Show
72
72
73−archiveToDocX :: Archive -> Maybe DocX
73+archiveToDocx :: Archive -> Maybe Docx
74−archiveToDocX archive = do
74+archiveToDocx archive = do
75 let notes = archiveToNotes archive
75 let notes = archiveToNotes archive
76 rels = archiveToRelationships archive
76 rels = archiveToRelationships archive
77 media = archiveToMedia archive
77 media = archiveToMedia archive
78 doc <- archiveToDocument archive
78 doc <- archiveToDocument archive
79 numbering <- archiveToNumbering archive
79 numbering <- archiveToNumbering archive
80− return $ DocX doc notes numbering rels media
80+ return $ Docx doc notes numbering rels media
81
81
82data Document = Document NameSpaces Body
82data Document = Document NameSpaces Body
83 deriving Show
83 deriving Show
tests/Tests/Readers/DocX.hs → tests/Tests/Readers/Docx.hsrenamed+3−3
@@ -1,4 +1,4 @@
1−module Tests.Readers.DocX (tests) where
1+module Tests.Readers.Docx (tests) where
2
2
3import Text.Pandoc.Options
3import Text.Pandoc.Options
4import Text.Pandoc.Readers.Native
4import Text.Pandoc.Readers.Native
@@ -6,13 +6,13 @@ import Text.Pandoc.Definition
6import Tests.Helpers
6import Tests.Helpers
7import Test.Framework
7import Test.Framework
8import qualified Data.ByteString.Lazy as B
8import qualified Data.ByteString.Lazy as B
9−import Text.Pandoc.Readers.DocX
9+import Text.Pandoc.Readers.Docx
10
10
11compareOutput :: FilePath -> FilePath -> IO (Pandoc, Pandoc)
11compareOutput :: FilePath -> FilePath -> IO (Pandoc, Pandoc)
12compareOutput docxFile nativeFile = do
12compareOutput docxFile nativeFile = do
13 df <- B.readFile docxFile
13 df <- B.readFile docxFile
14 nf <- Prelude.readFile nativeFile
14 nf <- Prelude.readFile nativeFile
15− return $ (readDocX def df, readNative nf)
15+ return $ (readDocx def df, readNative nf)
16
16
17testCompare' :: String -> FilePath -> FilePath -> IO Test
17testCompare' :: String -> FilePath -> FilePath -> IO Test
18testCompare' name docxFile nativeFile = do
18testCompare' name docxFile nativeFile = do
tests/test-pandoc.hs+2−2
@@ -9,7 +9,7 @@ import qualified Tests.Readers.LaTeX
9import qualified Tests.Readers.Markdown
9import qualified Tests.Readers.Markdown
10import qualified Tests.Readers.Org
10import qualified Tests.Readers.Org
11import qualified Tests.Readers.RST
11import qualified Tests.Readers.RST
12−import qualified Tests.Readers.DocX
12+import qualified Tests.Readers.Docx
13import qualified Tests.Writers.ConTeXt
13import qualified Tests.Writers.ConTeXt
14import qualified Tests.Writers.LaTeX
14import qualified Tests.Writers.LaTeX
15import qualified Tests.Writers.HTML
15import qualified Tests.Writers.HTML
@@ -39,7 +39,7 @@ tests = [ testGroup "Old" Tests.Old.tests
39 , testGroup "Markdown" Tests.Readers.Markdown.tests
39 , testGroup "Markdown" Tests.Readers.Markdown.tests
40 , testGroup "Org" Tests.Readers.Org.tests
40 , testGroup "Org" Tests.Readers.Org.tests
41 , testGroup "RST" Tests.Readers.RST.tests
41 , testGroup "RST" Tests.Readers.RST.tests
42− , testGroup "DocX" Tests.Readers.DocX.tests
42+ , testGroup "Docx" Tests.Readers.Docx.tests
43
43
44 ]
44 ]
45 ]
45 ]