summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Vong <alexvong1995@gmail.com>2015-09-25 03:54:41 +0800
committerAlex Vong <alexvong1995@gmail.com>2015-10-01 02:24:34 +0800
commitd7a19c22be073854ea3e2d677913c1d81991b182 (patch)
tree21c06516253fc903b25fd26bd933fe09e7efa45b
parentf5e33e0dce8a4f08e23a59a8b270d3dad94601e0 (diff)
Move the variable pandocVersion from `src/Text/Pandoc.hs` to
`src/Text/Pandoc/Shared.hs`, so that all Writers can access this variable without importing `src/Text/Pandoc.hs`, preventing circular import. * pandoc.hs: Import pandocVersion from `Text.Pandoc.Shared`. * src/Text/Pandoc.hs: Remove the definition of pandocVersion and relevant import. * src/Text/Pandoc/Shared.hs: Add the definition of pandocVersion and relevant import.
-rw-r--r--pandoc.hs2
-rw-r--r--src/Text/Pandoc.hs8
-rw-r--r--src/Text/Pandoc/Shared.hs10
3 files changed, 10 insertions, 10 deletions
diff --git a/pandoc.hs b/pandoc.hs
index 7d26dde39..b357754e2 100644
--- a/pandoc.hs
+++ b/pandoc.hs
@@ -37,7 +37,7 @@ import Text.Pandoc.Walk (walk)
import Text.Pandoc.Readers.LaTeX (handleIncludes)
import Text.Pandoc.Shared ( tabFilter, readDataFileUTF8, readDataFile,
safeRead, headerShift, normalize, err, warn,
- openURL )
+ openURL, pandocVersion )
import Text.Pandoc.MediaBag ( mediaDirectory, extractMediaBag, MediaBag )
import Text.Pandoc.XML ( toEntities )
import Text.Pandoc.SelfContained ( makeSelfContained )
diff --git a/src/Text/Pandoc.hs b/src/Text/Pandoc.hs
index d7311d978..842128124 100644
--- a/src/Text/Pandoc.hs
+++ b/src/Text/Pandoc.hs
@@ -117,8 +117,6 @@ module Text.Pandoc
, writeCustom
-- * Rendering templates and default templates
, module Text.Pandoc.Templates
- -- * Version
- , pandocVersion
-- * Miscellaneous
, getReader
, getWriter
@@ -178,17 +176,11 @@ import Text.Pandoc.Error
import Data.Aeson
import qualified Data.ByteString.Lazy as BL
import Data.List (intercalate)
-import Data.Version (showVersion)
import Data.Set (Set)
import qualified Data.Set as Set
import Text.Parsec
import Text.Parsec.Error
import qualified Text.Pandoc.UTF8 as UTF8
-import Paths_pandoc (version)
-
--- | Version number of pandoc library.
-pandocVersion :: String
-pandocVersion = showVersion version
parseFormatSpec :: String
-> Either ParseError (String, Set Extension -> Set Extension)
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 9bea0a65e..1fe3db5f7 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -92,7 +92,9 @@ module Text.Pandoc.Shared (
-- * Safe read
safeRead,
-- * Temp directory
- withTempDir
+ withTempDir,
+ -- * Version
+ pandocVersion
) where
import Text.Pandoc.Definition
@@ -106,6 +108,7 @@ import System.Exit (exitWith, ExitCode(..))
import Data.Char ( toLower, isLower, isUpper, isAlpha,
isLetter, isDigit, isSpace )
import Data.List ( find, stripPrefix, intercalate )
+import Data.Version ( showVersion )
import qualified Data.Map as M
import Network.URI ( escapeURIString, isURI, nonStrictRelativeTo,
unEscapeString, parseURIReference, isAllowedInURI )
@@ -136,6 +139,7 @@ import Data.Sequence (ViewR(..), ViewL(..), viewl, viewr)
import qualified Data.Text as T (toUpper, pack, unpack)
import Data.ByteString.Lazy (toChunks, fromChunks)
import qualified Data.ByteString.Lazy as BL
+import Paths_pandoc (version)
import Codec.Archive.Zip
@@ -165,6 +169,10 @@ import Network.HTTP (findHeader, rspBody,
import Network.Browser (browse, setAllowRedirects, setOutHandler, request)
#endif
+-- | Version number of pandoc library.
+pandocVersion :: String
+pandocVersion = showVersion version
+
--
-- List processing
--