@@ -1,54 +1,54 @@
1+{-
2+Copyright (C) 2012-2018 John MacFarlane <jgm@berkeley.edu>
3+
4+This program is free software; you can redistribute it and/or modify
5+it under the terms of the GNU General Public License as published by
6+the Free Software Foundation; either version 2 of the License, or
7+(at your option) any later version.
8+
9+This program is distributed in the hope that it will be useful,
10+but WITHOUT ANY WARRANTY; without even the implied warranty of
11+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+GNU General Public License for more details.
13+
14+You should have received a copy of the GNU General Public License
15+along with this program; if not, write to the Free Software
16+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17+-}
18+
19+{- |
20+ Module : Text.Pandoc.Writers.OOXML
21+ Copyright : Copyright (C) 2012-2018 John MacFarlane
22+ License : GNU GPL, version 2 or above
23+
24+ Maintainer : John MacFarlane <jgm@berkeley.edu>
25+ Stability : alpha
26+ Portability : portable
27+
28+Functions common to OOXML writers (Docx and Powerpoint)
29+-}
130module Text.Pandoc.Writers.OOXML ( mknode
2− , nodename
3− , toLazy
4− , renderXml
5− , parseXml
6− , elemToNameSpaces
7− , elemName
8− , isElem
9− , NameSpaces
10− , fitToPage
11− ) where
31+ , nodename
32+ , toLazy
33+ , renderXml
34+ , parseXml
35+ , elemToNameSpaces
36+ , elemName
37+ , isElem
38+ , NameSpaces
39+ , fitToPage
40+ ) where
41+
1242import Codec.Archive.Zip
13−--import Control.Applicative ((<|>))
14−-- import Control.Monad.Except (catchError)
1543import Control.Monad.Reader
16−-- import Control.Monad.State
1744import qualified Data.ByteString as B
1845import qualified Data.ByteString.Lazy as BL
1946import qualified Data.ByteString.Lazy.Char8 as BL8
20−-- import Data.Char (isSpace, ord, toLower)
21−-- import Data.List (intercalate, isPrefixOf, isSuffixOf)
22−-- import qualified Data.Map as M
2347import Data.Maybe (mapMaybe)
2448import Data.Monoid ((<>))
25−-- import qualified Data.Set as Set
26−-- import qualified Data.Text as T
27−-- import Data.Time.Clock.POSIX
28−-- import Skylighting
29−-- import System.Random (randomR)
3049import Text.Pandoc.Class (PandocMonad)
31−-- import qualified Text.Pandoc.Class as P
32−-- import Text.Pandoc.Compat.Time
33−-- import Text.Pandoc.Definition
34−-- import Text.Pandoc.Generic
35−-- import Text.Pandoc.Highlighting (highlight)
36−-- import Text.Pandoc.ImageSize
37−-- import Text.Pandoc.Logging
38−-- import Text.Pandoc.MIME (MimeType, extensionFromMimeType, getMimeType,
39−-- getMimeTypeDef)
40−-- import Text.Pandoc.Options
41−-- import Text.Pandoc.Readers.Docx.StyleMap
42−-- import Text.Pandoc.Shared hiding (Element)
4350import qualified Text.Pandoc.UTF8 as UTF8
44−-- import Text.Pandoc.Walk
45−-- import Text.Pandoc.Writers.Math
46−-- import Text.Pandoc.Writers.Shared (fixDisplayMath)
47−-- import Text.Printf (printf)
48−-- import Text.TeXMath
4951import Text.XML.Light as XML
50−-- import Text.XML.Light.Cursor as XMLC
51−
5252
5353mknode :: Node t => String -> [(String,String)] -> t -> Element
5454mknode s attrs =
@@ -106,4 +106,3 @@ fitToPage (x, y) pageWidth
106106 | x > fromIntegral pageWidth =
107107 (pageWidth, floor $ ((fromIntegral pageWidth) / x) * y)
108108 | otherwise = (floor x, floor y)
109−