Permalink
Browse files

Moved Gitit under Network namespace.

Gitit.Happstack is now Network.Gitit.
Gitit.X is now Network.Gitit.X.
The main program is now gitit.hs.
  • Loading branch information...
jgm committed Jun 15, 2009
1 parent 9fceaab commit 2e4d87e9f63ef34d486389523daa028643f8f758
@@ -19,20 +19,20 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- | Functions for embedding a gitit wiki into a Happstack application.
-}
-module Gitit.Happstack ( initializeAppState
- , readMimeTypesFile
- , mimeTypes
- , Config(..)
- , User(..)
- , Cache(..)
- , emptyCache
- , queryAppState
- , updateAppState
- , loadPlugin
- , module Gitit.Handlers
- )
+module Network.Gitit ( initializeAppState
+ , readMimeTypesFile
+ , mimeTypes
+ , Config(..)
+ , User(..)
+ , Cache(..)
+ , emptyCache
+ , queryAppState
+ , updateAppState
+ , loadPlugin
+ , module Network.Gitit.Handlers
+ )
where
-import Gitit.Types
-import Gitit.State
-import Gitit.Plugins (loadPlugin)
-import Gitit.Handlers
+import Network.Gitit.Types
+import Network.Gitit.State
+import Network.Gitit.Plugins (loadPlugin)
+import Network.Gitit.Handlers
@@ -20,13 +20,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- Handlers for registering and authenticating users.
-}
-module Gitit.Authentication where
+module Network.Gitit.Authentication where
-import Gitit.State
-import Gitit.Types
-import Gitit.Framework
-import Gitit.Layout
-import Gitit.Server
+import Network.Gitit.State
+import Network.Gitit.Types
+import Network.Gitit.Framework
+import Network.Gitit.Layout
+import Network.Gitit.Server
import Network.Captcha.ReCaptcha (captchaFields, validateCaptcha)
import Text.XHtml hiding ( (</>), dir, method, password, rev )
import qualified Text.XHtml as X ( password )
@@ -20,9 +20,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- Functions for parsing command line options and reading the config file.
-}
-module Gitit.Config ( getConfigFromOpts )
+module Network.Gitit.Config ( getConfigFromOpts )
where
-import Gitit.Types
+import Network.Gitit.Types
import Data.FileStore
import System.Environment
import System.Exit
@@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- Functions for content conversion.
-}
-module Gitit.ContentTransformer
+module Network.Gitit.ContentTransformer
(
-- ContentTransformer runners
runPageTransformer
@@ -83,12 +83,12 @@ module Gitit.ContentTransformer
where
import Prelude hiding (catch)
-import Gitit.Server
-import Gitit.Framework
-import Gitit.State
-import Gitit.Types
-import Gitit.Layout
-import Gitit.Export (exportFormats)
+import Network.Gitit.Server
+import Network.Gitit.Framework
+import Network.Gitit.State
+import Network.Gitit.Types
+import Network.Gitit.Layout
+import Network.Gitit.Export (exportFormats)
import qualified Data.FileStore as FS
import Data.Maybe (mapMaybe)
import Text.Pandoc
@@ -19,14 +19,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- Functions for exporting wiki pages in various formats.
-}
-module Gitit.Export ( exportFormats )
+module Network.Gitit.Export ( exportFormats )
where
import Text.Pandoc
import Text.Pandoc.ODT (saveOpenDocumentAsODT)
-import Gitit.Server
-import Gitit.Util (withTempDir)
-import Gitit.State
-import Gitit.Types
+import Network.Gitit.Server
+import Network.Gitit.Util (withTempDir)
+import Network.Gitit.State
+import Network.Gitit.Types
import Control.Monad.Trans (liftIO)
import Text.XHtml (noHtml)
import qualified Data.ByteString.Lazy as B
@@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- General framework for defining wiki actions.
-}
-module Gitit.Framework ( getLoggedInUser
+module Network.Gitit.Framework ( getLoggedInUser
, sessionTime
, unlessNoEdit
, unlessNoDelete
@@ -43,9 +43,9 @@ module Gitit.Framework ( getLoggedInUser
, withInput
)
where
-import Gitit.Server
-import Gitit.State
-import Gitit.Types
+import Network.Gitit.Server
+import Network.Gitit.State
+import Network.Gitit.Types
import Data.Char (toLower, isAscii, isDigit, isLetter)
import Control.Monad.Trans (MonadIO)
import Control.Monad (mzero, liftM, MonadPlus)
@@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- Handlers for wiki functions.
-}
-module Gitit.Handlers ( handleAny
+module Network.Gitit.Handlers ( handleAny
, debugHandler
, randomPage
, discussPage
@@ -57,20 +57,20 @@ module Gitit.Handlers ( handleAny
)
where
import Data.FileStore
-import Gitit.Server
-import Gitit.Framework
-import Gitit.Layout
-import Gitit.State
-import Gitit.Types
-import Gitit.Util (orIfNull)
-import Gitit.Authentication
-import Gitit.ContentTransformer (showRawPage, showFileAsText, showPage,
+import Network.Gitit.Server
+import Network.Gitit.Framework
+import Network.Gitit.Layout
+import Network.Gitit.State
+import Network.Gitit.Types
+import Network.Gitit.Util (orIfNull)
+import Network.Gitit.Authentication
+import Network.Gitit.ContentTransformer (showRawPage, showFileAsText, showPage,
exportPage, showHighlightedSource, preview, applyPreCommitPlugins)
import Control.Exception (throwIO, catch, try)
import Prelude hiding (writeFile, readFile, catch)
import System.Time
import System.FilePath
-import Gitit.State
+import Network.Gitit.State
import Text.XHtml hiding ( (</>), dir, method, password, rev )
import qualified Text.XHtml as X ( method )
import Data.List (intersperse, nub, sortBy, find, isPrefixOf, inits)
@@ -16,11 +16,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- Functions for initializing a Gitit wiki.
-}
-module Gitit.Initialize ( createStaticIfMissing, createRepoIfMissing )
+module Network.Gitit.Initialize ( createStaticIfMissing, createRepoIfMissing )
where
import System.FilePath ((</>), (<.>), takeExtension)
import Data.FileStore
-import Gitit.Types
+import Network.Gitit.Types
import Paths_gitit (getDataFileName)
import Control.Exception (throwIO, try)
import System.Directory (copyFile, createDirectoryIfMissing, doesDirectoryExist, getDirectoryContents)
@@ -79,7 +79,7 @@ of the basic types used by Pandoc (for example, @Inline@, @Block@,
>
> -- This plugin replaces profane words with "XXXXX".
>
-> import Gitit.Interface
+> import Network.Gitit.Interface
> import Data.Char (toLower)
>
> plugin :: Plugin
@@ -101,7 +101,7 @@ install directory and @X.Y.Z@ is the version number of gitit.
-}
-module Gitit.Interface ( Plugin(..)
+module Network.Gitit.Interface ( Plugin(..)
, PluginM
, mkPageTransform
, mkPageTransformM
@@ -123,8 +123,8 @@ module Gitit.Interface ( Plugin(..)
where
import Text.Pandoc.Definition
import Data.Data
-import Gitit.Types
-import Gitit.ContentTransformer
+import Network.Gitit.Types
+import Network.Gitit.ContentTransformer
import Control.Monad.Reader (ask)
import Control.Monad (liftM)
import Control.Monad.Trans (liftIO)
@@ -20,17 +20,17 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- Functions and data structures for wiki page layout.
-}
-module Gitit.Layout ( defaultPageLayout
+module Network.Gitit.Layout ( defaultPageLayout
, formattedPage
)
where
import Data.FileStore
-import Gitit.Server
-import Gitit.Framework
-import Gitit.State
-import Gitit.Types
-import Gitit.Util (orIfNull)
-import Gitit.Export (exportFormats)
+import Network.Gitit.Server
+import Network.Gitit.Framework
+import Network.Gitit.State
+import Network.Gitit.Types
+import Network.Gitit.Util (orIfNull)
+import Network.Gitit.Export (exportFormats)
import Network.HTTP (urlEncodeVars)
import Codec.Binary.UTF8.String (encodeString)
import qualified Text.StringTemplate as T
@@ -20,9 +20,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- Functions for loading plugins.
-}
-module Gitit.Plugins ( loadPlugin )
+module Network.Gitit.Plugins ( loadPlugin )
where
-import Gitit.Types
+import Network.Gitit.Types
import System.FilePath
#ifdef _PLUGINS
import Control.Monad (unless)
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
addresses.
-}
-module Gitit.Server
+module Network.Gitit.Server
( look
, lookPairs
, lookRead
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- Functions for maintaining user list and session state.
-}
-module Gitit.State where
+module Network.Gitit.State where
import qualified Data.Map as M
import System.Random (randomRIO)
@@ -36,7 +36,7 @@ import Data.List (intercalate, minimumBy)
import Data.Ord (comparing)
import Text.XHtml (Html, renderHtmlFragment, primHtml)
import System.Log.Logger (Priority(..), logM)
-import Gitit.Types
+import Network.Gitit.Types
appstate :: IORef AppState
appstate = unsafePerformIO $ newIORef AppState { sessions = undefined
@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- Types for Gitit modules.
-}
-module Gitit.Types where
+module Network.Gitit.Types where
import System.Time (ClockTime)
import Control.Monad.Reader (ReaderT, runReaderT, mplus)
@@ -38,7 +38,7 @@ import Data.DateTime
import Data.List (intersect)
import Data.Maybe (fromMaybe)
import Data.FileStore.Types
-import Gitit.Server
+import Network.Gitit.Server
data PageType = Markdown | RST | LaTeX | HTML
deriving (Read, Show)
@@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{- Utility functions for Gitit.
-}
-module Gitit.Util ( withTempDir
+module Network.Gitit.Util ( withTempDir
, orIfNull
)
where
View
@@ -55,24 +55,24 @@ Flag plugins
Library
hs-source-dirs: .
- exposed-modules: Gitit.Happstack
+ exposed-modules: Network.Gitit
if flag(plugins)
- exposed-modules: Gitit.Interface
- other-modules: Gitit.Types, Gitit.State, Gitit.Server,
- Gitit.ContentTransformer, Gitit.Layout,
- Gitit.Export, Gitit.Framework, Gitit.Util, Gitit.Handlers
+ exposed-modules: Network.Gitit.Interface
+ other-modules: Network.Gitit.Types, Network.Gitit.State, Network.Gitit.Server,
+ Network.Gitit.ContentTransformer, Network.Gitit.Layout,
+ Network.Gitit.Export, Network.Gitit.Framework, Network.Gitit.Util, Network.Gitit.Handlers
build-depends: base >= 3, pandoc >= 1.1, filepath
ghc-options: -Wall
ghc-prof-options: -auto-all -caf-all
Executable gitit
hs-source-dirs: .
- main-is: Gitit.hs
- other-modules: Gitit.Types, Gitit.State, Gitit.Server,
- Gitit.Util, Gitit.Export, Gitit.Layout,
- Gitit.ContentTransformer, Gitit.Initialize,
- Gitit.Config, Gitit.Framework, Gitit.Handlers,
- Gitit.Plugins, Paths_gitit, Gitit.Authentication
+ main-is: gitit.hs
+ other-modules: Network.Gitit.Types, Network.Gitit.State, Network.Gitit.Server,
+ Network.Gitit.Util, Network.Gitit.Export, Network.Gitit.Layout,
+ Network.Gitit.ContentTransformer, Network.Gitit.Initialize,
+ Network.Gitit.Config, Network.Gitit.Framework, Network.Gitit.Handlers,
+ Network.Gitit.Plugins, Paths_gitit, Network.Gitit.Authentication
build-depends: base >=3, parsec < 3, pretty, xhtml, containers, pandoc
>= 1.2, process, filepath, directory, mtl, cgi,
network, old-time, highlighting-kate, bytestring,
View
@@ -19,18 +19,18 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
module Main where
-import Gitit.Plugins ( loadPlugin )
-import Gitit.Types
-import Gitit.Server
-import Gitit.Initialize (createStaticIfMissing, createRepoIfMissing)
-import Gitit.Framework
-import Gitit.Handlers
+import Network.Gitit.Plugins ( loadPlugin )
+import Network.Gitit.Types
+import Network.Gitit.Server
+import Network.Gitit.Initialize (createStaticIfMissing, createRepoIfMissing)
+import Network.Gitit.Framework
+import Network.Gitit.Handlers
import Prelude hiding (writeFile, readFile, catch)
import System.Directory
import System.FilePath ((</>))
import Control.Concurrent
-import Gitit.State
-import Gitit.Config (getConfigFromOpts)
+import Network.Gitit.State
+import Network.Gitit.Config (getConfigFromOpts)
import Data.Maybe (isNothing)
import qualified Data.Map as M
import System.IO.UTF8 (readFile)

0 comments on commit 2e4d87e

Please sign in to comment.