-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Wiki using happstack, git or darcs, and pandoc.
--   
--   Gitit is a wiki backed by a git, darcs, or mercurial filestore. Pages
--   and uploaded files can be modified either directly via the VCS's
--   command-line tools or through the wiki's web interface. Pandoc is used
--   for markup processing, so pages may be written in (extended) markdown,
--   reStructuredText, LaTeX, HTML, or literate Haskell.
--   
--   Notable features include
--   
--   <ul>
--   <li>plugins: dynamically loaded page transformations written in
--   Haskell (see <a>Network.Gitit.Interface</a>)</li>
--   <li>conversion of TeX math to MathML for display in web browsers</li>
--   <li>syntax highlighting of source code files and code snippets</li>
--   <li>Atom feeds (site-wide and per-page)</li>
--   <li>a library, <a>Network.Gitit</a>, that makes it simple to include a
--   gitit wiki in any happstack application</li>
--   </ul>
--   
--   For usage information: <tt>gitit --help</tt>
@package gitit
@version 0.15.1.2

module Network.Gitit.Compat.Except

-- | A monad transformer that adds exceptions to other monads.
--   
--   <tt>ExceptT</tt> constructs a monad parameterized over two things:
--   
--   <ul>
--   <li>e - The exception type.</li>
--   <li>m - The inner monad.</li>
--   </ul>
--   
--   The <a>return</a> function yields a computation that produces the
--   given value, while <tt>&gt;&gt;=</tt> sequences two subcomputations,
--   exiting on the first exception.
data ExceptT e (m :: Type -> Type) a

-- | The parameterizable exception monad.
--   
--   Computations are either exceptions or normal values.
--   
--   The <a>return</a> function returns a normal value, while
--   <tt>&gt;&gt;=</tt> exits on the first exception. For a variant that
--   continues after an error and collects all the errors, see
--   <a>Errors</a>.
type Except e = ExceptT e Identity
class Error a
noMsg :: Error a => a
strMsg :: Error a => String -> a

-- | The inverse of <a>ExceptT</a>.
runExceptT :: ExceptT e m a -> m (Either e a)

-- | Extractor for computations in the exception monad. (The inverse of
--   <a>except</a>).
runExcept :: Except e a -> Either e a

-- | The strategy of combining computations that can throw exceptions by
--   bypassing bound functions from the point an exception is thrown to the
--   point that it is handled.
--   
--   Is parameterized over the type of error information and the monad type
--   constructor. It is common to use <tt><a>Either</a> String</tt> as the
--   monad type constructor for an error monad in which error descriptions
--   take the form of strings. In that case and many other common cases the
--   resulting monad is already defined as an instance of the
--   <a>MonadError</a> class. You can also define your own error type
--   and/or use a monad type constructor other than <tt><a>Either</a>
--   <tt>String</tt></tt> or <tt><a>Either</a> <tt>IOError</tt></tt>. In
--   these cases you will have to explicitly define instances of the
--   <a>MonadError</a> class. (If you are using the deprecated
--   <a>Control.Monad.Error</a> or <a>Control.Monad.Trans.Error</a>, you
--   may also have to define an <tt>Error</tt> instance.)
class Monad m => MonadError e (m :: Type -> Type) | m -> e

-- | Is used within a monadic computation to begin exception processing.
throwError :: MonadError e m => e -> m a

-- | A handler function to handle previous errors and return to normal
--   execution. A common idiom is:
--   
--   <pre>
--   do { action1; action2; action3 } `catchError` handler
--   </pre>
--   
--   where the <tt>action</tt> functions can call <a>throwError</a>. Note
--   that <tt>handler</tt> and the do-block must have the same return type.
catchError :: MonadError e m => m a -> (e -> m a) -> m a

module Network.Gitit.Rpxnow

-- | Information received from Rpxnow after a valid login.
data Identifier
Identifier :: String -> [(String, String)] -> Identifier
[userIdentifier] :: Identifier -> String
[userData] :: Identifier -> [(String, String)]

-- | Attempt to log a user in.
authenticate :: String -> String -> IO (Either String Identifier)
instance GHC.Internal.Show.Show Network.Gitit.Rpxnow.Identifier

module Network.Gitit.Server
withExpiresHeaders :: ServerMonad m => m Response -> m Response
setContentType :: String -> Response -> Response
setFilename :: String -> Response -> Response
lookupIPAddr :: String -> IO (Maybe String)
getHost :: ServerMonad m => m (Maybe String)

-- | reads the <tt>Accept-Encoding</tt> header. Then, if possible will
--   compress the response body with methods <tt>gzip</tt> or
--   <tt>deflate</tt>.
--   
--   This function uses <a>standardEncodingHandlers</a>. If you want to
--   provide alternative handers (perhaps to change compression levels),
--   see <a>compressedResponseFilter'</a>
--   
--   <pre>
--   main =
--     simpleHTTP nullConf $
--        do str &lt;- compressedResponseFilter
--           return $ toResponse ("This response compressed using: " ++ str)
--   </pre>
compressedResponseFilter :: (FilterMonad Response m, MonadPlus m, WebMonad Response m, ServerMonad m, MonadFail m) => m String


-- | Types for Gitit modules.
module Network.Gitit.Types
data PageType
Markdown :: PageType
CommonMark :: PageType
RST :: PageType
LaTeX :: PageType
HTML :: PageType
Textile :: PageType
Org :: PageType
DocBook :: PageType
MediaWiki :: PageType
data FileStoreType
Git :: FileStoreType
Darcs :: FileStoreType
Mercurial :: FileStoreType
data MathMethod
MathML :: MathMethod
WebTeX :: String -> MathMethod
RawTeX :: MathMethod
MathJax :: String -> MathMethod
data AuthenticationLevel
Never :: AuthenticationLevel
ForModify :: AuthenticationLevel
ForRead :: AuthenticationLevel

-- | Data structure for information read from config file.
data Config
Config :: FilePath -> FileStoreType -> PageType -> String -> MathMethod -> Bool -> Bool -> (Handler -> Handler) -> AuthenticationLevel -> Handler -> FilePath -> Int -> FilePath -> FilePath -> Priority -> FilePath -> [String] -> Bool -> Integer -> Integer -> String -> Int -> Bool -> String -> [String] -> [String] -> String -> String -> Maybe (String, [String]) -> Bool -> Bool -> String -> String -> String -> String -> Bool -> Bool -> FilePath -> Map String String -> String -> String -> Text -> Bool -> String -> Bool -> String -> Integer -> Integer -> Maybe FilePath -> Bool -> Int -> GithubConfig -> Config

-- | Path of repository containing filestore
[repositoryPath] :: Config -> FilePath

-- | Type of repository
[repositoryType] :: Config -> FileStoreType

-- | Default page markup type for this wiki
[defaultPageType] :: Config -> PageType

-- | Default file extension for pages in this wiki
[defaultExtension] :: Config -> String

-- | How to handle LaTeX math in pages?
[mathMethod] :: Config -> MathMethod

-- | Treat as literate haskell by default?
[defaultLHS] :: Config -> Bool

-- | Show Haskell code with bird tracks
[showLHSBirdTracks] :: Config -> Bool

-- | Combinator to set <tt>REMOTE_USER</tt> request header
[withUser] :: Config -> Handler -> Handler

-- | Handler for login, logout, register, etc.
[requireAuthentication] :: Config -> AuthenticationLevel

-- | Specifies which actions require authentication.
[authHandler] :: Config -> Handler

-- | Path of users database
[userFile] :: Config -> FilePath

-- | Seconds of inactivity before session expires
[sessionTimeout] :: Config -> Int

-- | Directory containing page templates
[templatesDir] :: Config -> FilePath

-- | Path of server log file
[logFile] :: Config -> FilePath

-- | Severity filter for log messages (DEBUG, INFO, NOTICE, WARNING, ERROR,
--   CRITICAL, ALERT, EMERGENCY)
[logLevel] :: Config -> Priority

-- | Path of static directory
[staticDir] :: Config -> FilePath

-- | Names of plugin modules to load
[pluginModules] :: Config -> [String]

-- | Show table of contents on each page?
[tableOfContents] :: Config -> Bool

-- | Max size of file uploads
[maxUploadSize] :: Config -> Integer

-- | Max size of page uploads
[maxPageSize] :: Config -> Integer

-- | IP address to bind to
[address] :: Config -> String

-- | Port number to serve content on
[portNumber] :: Config -> Int

-- | Print debug info to the console?
[debugMode] :: Config -> Bool

-- | The front page of the wiki
[frontPage] :: Config -> String

-- | Pages that cannot be edited via web
[noEdit] :: Config -> [String]

-- | Pages that cannot be deleted via web
[noDelete] :: Config -> [String]

-- | Default summary if description left blank
[defaultSummary] :: Config -> String

-- | Delete summary
[deleteSummary] :: Config -> String

-- | <tt>Nothing</tt> = anyone can register. <tt>Just (prompt,
--   answers)</tt> = a user will be given the prompt and must give one of
--   the answers to register.
[accessQuestion] :: Config -> Maybe (String, [String])

-- | Disable Registration?
[disableRegistration] :: Config -> Bool

-- | Use ReCAPTCHA for user registration.
[useRecaptcha] :: Config -> Bool
[recaptchaPublicKey] :: Config -> String
[recaptchaPrivateKey] :: Config -> String

-- | RPX domain and key
[rpxDomain] :: Config -> String
[rpxKey] :: Config -> String

-- | Should responses be compressed?
[compressResponses] :: Config -> Bool

-- | Should responses be cached?
[useCache] :: Config -> Bool

-- | Directory to hold cached pages
[cacheDir] :: Config -> FilePath

-- | Map associating mime types with file extensions
[mimeMap] :: Config -> Map String String

-- | Command to send notification emails
[mailCommand] :: Config -> String

-- | Text of password reset email
[resetPasswordMessage] :: Config -> String

-- | Markup syntax help for edit sidebar
[markupHelp] :: Config -> Text

-- | Provide an atom feed?
[useFeed] :: Config -> Bool

-- | Base URL of wiki, for use in feed
[baseUrl] :: Config -> String

-- | Title of wiki, used in feed
[useAbsoluteUrls] :: Config -> Bool

-- | Should WikiLinks be absolute w.r.t. the base URL?
[wikiTitle] :: Config -> String

-- | Number of days history to be included in feed
[feedDays] :: Config -> Integer

-- | Number of minutes to cache feeds before refreshing
[feedRefreshTime] :: Config -> Integer

-- | Directory to search for pandoc customizations
[pandocUserData] :: Config -> Maybe FilePath

-- | Filter HTML through xss-sanitize
[xssSanitize] :: Config -> Bool

-- | The default number of days in the past to look for "recent" activity
[recentActivityDays] :: Config -> Int

-- | Github client data for authentication (id, secret, callback, authorize
--   endpoint, access token endpoint)
[githubAuth] :: Config -> GithubConfig

-- | Data for rendering a wiki page.
data Page
Page :: String -> PageType -> Bool -> Bool -> String -> [String] -> String -> [(String, String)] -> Page
[pageName] :: Page -> String
[pageFormat] :: Page -> PageType
[pageLHS] :: Page -> Bool
[pageTOC] :: Page -> Bool
[pageTitle] :: Page -> String
[pageCategories] :: Page -> [String]
[pageText] :: Page -> String
[pageMeta] :: Page -> [(String, String)]
newtype SessionKey
SessionKey :: Integer -> SessionKey
data SessionData
data SessionGithubData
sessionData :: String -> SessionData
sessionGithubData :: SessionData -> Maybe SessionGithubData
sessionDataGithubStateUrl :: String -> String -> SessionData
sessionUser :: SessionData -> Maybe String
sessionGithubState :: SessionGithubData -> String
sessionGithubDestination :: SessionGithubData -> String
data User
User :: String -> Password -> String -> User
[uUsername] :: User -> String
[uPassword] :: User -> Password
[uEmail] :: User -> String
data Sessions a
Sessions :: Map SessionKey a -> Sessions a
[unsession] :: Sessions a -> Map SessionKey a
data Password
Password :: String -> String -> Password
[pSalt] :: Password -> String
[pHashed] :: Password -> String

-- | Common state for all gitit wikis in an application.
data GititState
GititState :: Sessions SessionData -> Map String User -> FilePath -> (PageLayout -> Html -> Handler) -> [Plugin] -> GititState
[sessions] :: GititState -> Sessions SessionData
[users] :: GititState -> Map String User
[templatesPath] :: GititState -> FilePath
[renderPage] :: GititState -> PageLayout -> Html -> Handler
[plugins] :: GititState -> [Plugin]
class Monad m => HasContext (m :: Type -> Type)
modifyContext :: HasContext m => (Context -> Context) -> m ()
getContext :: HasContext m => m Context
type ContentTransformer = StateT Context GititServerPart
data Plugin
PageTransform :: (Pandoc -> PluginM Pandoc) -> Plugin
PreParseTransform :: (String -> PluginM String) -> Plugin
PreCommitTransform :: (String -> PluginM String) -> Plugin
data PluginData
PluginData :: Config -> Maybe User -> Request -> FileStore -> PluginData
[pluginConfig] :: PluginData -> Config
[pluginUser] :: PluginData -> Maybe User
[pluginRequest] :: PluginData -> Request
[pluginFileStore] :: PluginData -> FileStore
type PluginM = ReaderT PluginData StateT Context IO
runPluginM :: PluginM a -> PluginData -> Context -> IO (a, Context)
data Context
Context :: String -> PageLayout -> Bool -> Bool -> Bool -> [String] -> [(String, String)] -> Context
[ctxFile] :: Context -> String
[ctxLayout] :: Context -> PageLayout
[ctxCacheable] :: Context -> Bool
[ctxTOC] :: Context -> Bool
[ctxBirdTracks] :: Context -> Bool
[ctxCategories] :: Context -> [String]
[ctxMeta] :: Context -> [(String, String)]

-- | Abstract representation of page layout (tabs, scripts, etc.)
data PageLayout
PageLayout :: String -> Maybe String -> Bool -> [String] -> String -> [String] -> Bool -> Bool -> Maybe Text -> [Tab] -> Tab -> Bool -> PageLayout
[pgPageName] :: PageLayout -> String
[pgRevision] :: PageLayout -> Maybe String
[pgPrintable] :: PageLayout -> Bool
[pgMessages] :: PageLayout -> [String]
[pgTitle] :: PageLayout -> String
[pgScripts] :: PageLayout -> [String]
[pgShowPageTools] :: PageLayout -> Bool
[pgShowSiteNav] :: PageLayout -> Bool
[pgMarkupHelp] :: PageLayout -> Maybe Text
[pgTabs] :: PageLayout -> [Tab]
[pgSelectedTab] :: PageLayout -> Tab
[pgLinkToFeed] :: PageLayout -> Bool
data Tab
ViewTab :: Tab
EditTab :: Tab
HistoryTab :: Tab
DiscussTab :: Tab
DiffTab :: Tab
data Recaptcha
Recaptcha :: String -> String -> Recaptcha
[recaptchaChallengeField] :: Recaptcha -> String
[recaptchaResponseField] :: Recaptcha -> String
data Params
Params :: String -> String -> String -> Maybe String -> String -> Maybe String -> Maybe UTCTime -> String -> Int -> [String] -> String -> String -> Maybe String -> [String] -> Maybe String -> Maybe String -> String -> String -> String -> String -> String -> String -> String -> Bool -> Bool -> String -> FilePath -> Bool -> Maybe SessionKey -> Recaptcha -> String -> Maybe Bool -> Params
[pUsername] :: Params -> String
[pPassword] :: Params -> String
[pPassword2] :: Params -> String
[pRevision] :: Params -> Maybe String
[pDestination] :: Params -> String
[pForUser] :: Params -> Maybe String
[pSince] :: Params -> Maybe UTCTime
[pRaw] :: Params -> String
[pLimit] :: Params -> Int
[pPatterns] :: Params -> [String]
[pGotoPage] :: Params -> String
[pFileToDelete] :: Params -> String
[pEditedText] :: Params -> Maybe String
[pMessages] :: Params -> [String]
[pFrom] :: Params -> Maybe String
[pTo] :: Params -> Maybe String
[pFormat] :: Params -> String
[pSHA1] :: Params -> String
[pLogMsg] :: Params -> String
[pEmail] :: Params -> String
[pFullName] :: Params -> String
[pAccessCode] :: Params -> String
[pWikiname] :: Params -> String
[pPrintable] :: Params -> Bool
[pOverwrite] :: Params -> Bool
[pFilename] :: Params -> String
[pFilePath] :: Params -> FilePath
[pConfirm] :: Params -> Bool
[pSessionKey] :: Params -> Maybe SessionKey
[pRecaptcha] :: Params -> Recaptcha
[pResetCode] :: Params -> String
[pRedirect] :: Params -> Maybe Bool
data Command
Command :: Maybe String -> Command

-- | State for a single wiki.
data WikiState
WikiState :: Config -> FileStore -> WikiState
[wikiConfig] :: WikiState -> Config
[wikiFileStore] :: WikiState -> FileStore
type GititServerPart = ServerPartT ReaderT WikiState IO
type Handler = GititServerPart Response
fromEntities :: String -> String
data GithubConfig
oAuth2 :: GithubConfig -> OAuth2
org :: GithubConfig -> Maybe Text
githubConfig :: OAuth2 -> Maybe Text -> GithubConfig
instance GHC.Classes.Eq Network.Gitit.Types.AuthenticationLevel
instance GHC.Classes.Eq Network.Gitit.Types.MathMethod
instance GHC.Classes.Eq Network.Gitit.Types.PageType
instance GHC.Classes.Eq Network.Gitit.Types.Password
instance GHC.Classes.Eq Network.Gitit.Types.SessionData
instance GHC.Classes.Eq Network.Gitit.Types.SessionGithubData
instance GHC.Classes.Eq Network.Gitit.Types.SessionKey
instance GHC.Classes.Eq a => GHC.Classes.Eq (Network.Gitit.Types.Sessions a)
instance GHC.Classes.Eq Network.Gitit.Types.Tab
instance Happstack.Server.RqData.FromData Network.Gitit.Types.Command
instance Happstack.Server.RqData.FromData Network.Gitit.Types.Params
instance Happstack.Server.RqData.FromData Network.Gitit.Types.SessionKey
instance Happstack.Server.Internal.Types.FromReqURI Network.Gitit.Types.SessionKey
instance Network.Gitit.Types.HasContext Network.Gitit.Types.PluginM
instance Network.Gitit.Types.HasContext Network.Gitit.Types.ContentTransformer
instance GHC.Classes.Ord Network.Gitit.Types.AuthenticationLevel
instance GHC.Classes.Ord Network.Gitit.Types.SessionKey
instance GHC.Internal.Read.Read Network.Gitit.Types.AuthenticationLevel
instance GHC.Internal.Read.Read Network.Gitit.Types.MathMethod
instance GHC.Internal.Read.Read Network.Gitit.Types.Page
instance GHC.Internal.Read.Read Network.Gitit.Types.PageType
instance GHC.Internal.Read.Read Network.Gitit.Types.Password
instance GHC.Internal.Read.Read Network.Gitit.Types.Recaptcha
instance GHC.Internal.Read.Read Network.Gitit.Types.SessionData
instance GHC.Internal.Read.Read Network.Gitit.Types.SessionGithubData
instance GHC.Internal.Read.Read Network.Gitit.Types.SessionKey
instance GHC.Internal.Read.Read a => GHC.Internal.Read.Read (Network.Gitit.Types.Sessions a)
instance GHC.Internal.Read.Read Network.Gitit.Types.User
instance GHC.Internal.Show.Show Network.Gitit.Types.AuthenticationLevel
instance GHC.Internal.Show.Show Network.Gitit.Types.Command
instance GHC.Internal.Show.Show Network.Gitit.Types.FileStoreType
instance GHC.Internal.Show.Show Network.Gitit.Types.MathMethod
instance GHC.Internal.Show.Show Network.Gitit.Types.Page
instance GHC.Internal.Show.Show Network.Gitit.Types.PageType
instance GHC.Internal.Show.Show Network.Gitit.Types.Params
instance GHC.Internal.Show.Show Network.Gitit.Types.Password
instance GHC.Internal.Show.Show Network.Gitit.Types.Recaptcha
instance GHC.Internal.Show.Show Network.Gitit.Types.SessionData
instance GHC.Internal.Show.Show Network.Gitit.Types.SessionGithubData
instance GHC.Internal.Show.Show Network.Gitit.Types.SessionKey
instance GHC.Internal.Show.Show a => GHC.Internal.Show.Show (Network.Gitit.Types.Sessions a)
instance GHC.Internal.Show.Show Network.Gitit.Types.Tab
instance GHC.Internal.Show.Show Network.Gitit.Types.User

module Network.Gitit.State
gititstate :: IORef GititState
updateGititState :: MonadIO m => (GititState -> GititState) -> m ()
queryGititState :: MonadIO m => (GititState -> a) -> m a
debugMessage :: String -> GititServerPart ()
mkUser :: String -> String -> String -> IO User
genSalt :: IO String
hashPassword :: String -> String -> String
authUser :: String -> String -> GititServerPart Bool
isUser :: String -> GititServerPart Bool
addUser :: String -> User -> GititServerPart ()
adjustUser :: String -> User -> GititServerPart ()
delUser :: String -> GititServerPart ()
writeUserFile :: Config -> IO ()
getUser :: String -> GititServerPart (Maybe User)
isSession :: MonadIO m => SessionKey -> m Bool
setSession :: MonadIO m => SessionKey -> SessionData -> m ()
newSession :: MonadIO m => SessionData -> m SessionKey
delSession :: MonadIO m => SessionKey -> m ()
getSession :: MonadIO m => SessionKey -> m (Maybe SessionData)
getConfig :: GititServerPart Config
getFileStore :: GititServerPart FileStore
getDefaultPageType :: GititServerPart PageType
getDefaultLHS :: GititServerPart Bool

module Network.Gitit.Plugins
loadPlugin :: FilePath -> IO Plugin
loadPlugins :: [FilePath] -> IO [Plugin]


-- | Useful functions for defining wiki handlers.
module Network.Gitit.Framework

-- | Run the handler after setting <tt>REMOTE_USER</tt> with the user from
--   the session.
withUserFromSession :: Handler -> Handler

-- | Run the handler after setting <tt>REMOTE_USER</tt> from the
--   "authorization" header. Works with simple HTTP authentication or
--   digest authentication.
withUserFromHTTPAuth :: Handler -> Handler

-- | Like <a>authenticate</a>, but with a predicate that the user must
--   satisfy.
authenticateUserThat :: (User -> Bool) -> AuthenticationLevel -> Handler -> Handler

-- | Require a logged in user if the authentication level demands it. Run
--   the handler if a user is logged in, otherwise redirect to login page.
authenticate :: AuthenticationLevel -> Handler -> Handler

-- | Returns <tt>Just</tt> logged in user or <tt>Nothing</tt>.
getLoggedInUser :: GititServerPart (Maybe User)

-- | <tt>unlessNoEdit responder fallback</tt> runs <tt>responder</tt>
--   unless the page has been designated not editable in configuration; in
--   that case, runs <tt>fallback</tt>.
unlessNoEdit :: Handler -> Handler -> Handler

-- | <tt>unlessNoDelete responder fallback</tt> runs <tt>responder</tt>
--   unless the page has been designated not deletable in configuration; in
--   that case, runs <tt>fallback</tt>.
unlessNoDelete :: Handler -> Handler -> Handler
guardCommand :: String -> GititServerPart ()
guardPath :: (String -> Bool) -> GititServerPart ()

-- | Succeeds if path is an index path: e.g. <tt>/foo/bar/</tt>.
guardIndex :: GititServerPart ()
guardBareBase :: GititServerPart ()

-- | Returns the current path (subtracting initial commands like
--   <tt>/_edit</tt>).
getPath :: ServerMonad m => m String

-- | Returns the current page name (derived from the path).
getPage :: GititServerPart String

-- | Returns the contents of the "referer" header.
getReferer :: ServerMonad m => m String

-- | Returns the base URL of the wiki in the happstack server. So, if the
--   wiki handlers are behind a <tt>dir <tt>foo</tt></tt>, getWikiBase will
--   return <tt>/foo/</tt>. getWikiBase doesn't know anything about HTTP
--   proxies, so if you use proxies to map a gitit wiki to <tt>/foo/</tt>,
--   you'll still need to follow the instructions in README.
getWikiBase :: ServerMonad m => m String

-- | Returns path portion of URI, without initial <tt>/</tt>. Consecutive
--   spaces are collapsed. We don't want to distinguish <tt>Hi There</tt>
--   and <tt>Hi There</tt>.
uriPath :: String -> String
isPage :: String -> Bool
isPageFile :: FilePath -> GititServerPart Bool
isDiscussPage :: String -> Bool
isDiscussPageFile :: FilePath -> GititServerPart Bool
isNotDiscussPageFile :: FilePath -> GititServerPart Bool
isSourceCode :: String -> Bool

-- | Runs a server monad in a local context after setting the "message"
--   request header.
withMessages :: ServerMonad m => [String] -> m a -> m a

-- | Returns encoded URL path for the page with the given name, relative to
--   the wiki base.
urlForPage :: String -> String

-- | Returns the filestore path of the file containing the page's source.
pathForPage :: String -> String -> FilePath

-- | Retrieves a mime type based on file extension.
getMimeTypeForExtension :: String -> GititServerPart String

-- | Simple helper for validation of forms.
validate :: [(Bool, String)] -> [String]

-- | Returns a filestore object derived from the repository path and
--   filestore type specified in configuration.
filestoreFromConfig :: Config -> FileStore
mkSessionCookie :: SessionKey -> Cookie

module Network.Gitit.Layout
defaultPageLayout :: PageLayout

-- | Given a compiled string template, returns a page renderer.
defaultRenderPage :: StringTemplate String -> PageLayout -> Html -> Handler

-- | Returns formatted page
formattedPage :: PageLayout -> Html -> Handler

-- | Returns a page template with gitit variables filled in.
filledPageTemplate :: String -> Config -> PageLayout -> Html -> StringTemplate String -> StringTemplate String
uploadsAllowed :: Config -> Bool

module Network.Gitit.Cache

-- | Expire a cached file, identified by its filename in the filestore.
--   Returns () after deleting a file from the cache, fails if no cached
--   file.
expireCachedFile :: String -> GititServerPart ()
lookupCache :: String -> GititServerPart (Maybe (UTCTime, ByteString))
cacheContents :: String -> ByteString -> GititServerPart ()

module Network.Gitit.Util

-- | Read file as UTF-8 string. Encode filename as UTF-8.
readFileUTF8 :: FilePath -> IO Text

-- | Perform a function a directory and return to working directory.
inDir :: FilePath -> IO a -> IO a

-- | Perform a function in a temporary directory and clean up.
withTempDir :: FilePath -> (FilePath -> IO a) -> IO a

-- | Returns a list, if it is not null, or a backup, if it is.
orIfNull :: [a] -> [a] -> [a]

-- | Split a string containing a list of categories.
splitCategories :: String -> [String]

-- | Trim leading and trailing spaces.
trim :: String -> String

-- | Show Bool as "yes" or "no".
yesOrNo :: Bool -> String
parsePageType :: String -> (PageType, Bool)
encUrl :: String -> String
getPageTypeDefaultExtensions :: PageType -> Bool -> Extensions

module Network.Gitit.Page

-- | Read a string (the contents of a page file) and produce a Page object,
--   using defaults except when overridden by metadata.
stringToPage :: Config -> String -> String -> Page

-- | Write a string (the contents of a page file) corresponding to a Page
--   object, using explicit metadata only when needed.
pageToString :: Config -> Page -> String

-- | Read categories from metadata strictly.
readCategories :: FilePath -> IO [String]

module Network.Gitit.ContentTransformer
runPageTransformer :: ToMessage a => ContentTransformer a -> GititServerPart a
runFileTransformer :: ToMessage a => ContentTransformer a -> GititServerPart a

-- | Converts a <tt>ContentTransformer</tt> into a
--   <tt>GititServerPart</tt>; specialized to wiki pages.
--   runPageTransformer :: ToMessage a =&gt; ContentTransformer a -&gt;
--   GititServerPart a runPageTransformer = runTransformer pathForPage
--   
--   Converts a <tt>ContentTransformer</tt> into a
--   <tt>GititServerPart</tt>; specialized to non-pages. runFileTransformer
--   :: ToMessage a =&gt; ContentTransformer a -&gt; GititServerPart a
--   runFileTransformer = runTransformer id
--   
--   Responds with raw page source.
showRawPage :: Handler

-- | Responds with raw source (for non-pages such as source code files).
showFileAsText :: Handler

-- | Responds with rendered wiki page.
showPage :: Handler

-- | Responds with highlighted source code.
showHighlightedSource :: Handler

-- | Responds with non-highlighted source code.
showFile :: Handler

-- | Responds with rendered page derived from form data.
preview :: Handler

-- | Applies pre-commit plugins to raw page source, possibly modifying it.
applyPreCommitPlugins :: String -> GititServerPart String

-- | Caches a response (actually just the response body) on disk, unless
--   the context indicates that the page is not cacheable.
cacheHtml :: Response -> ContentTransformer Response

-- | Returns cached page if available, otherwise mzero.
cachedHtml :: ContentTransformer Response

-- | Returns raw file contents.
rawContents :: ContentTransformer (Maybe String)

-- | Converts raw contents to a text/plain response.
textResponse :: Maybe String -> ContentTransformer Response

-- | Converts raw contents to a response that is appropriate with a mime
--   type derived from the page's extension.
mimeFileResponse :: Maybe String -> ContentTransformer Response
mimeResponse :: Monad m => String -> String -> m Response

-- | Adds the sidebar, page tabs, and other elements of the wiki page
--   layout to the raw content.
applyWikiTemplate :: Html -> ContentTransformer Response

-- | Converts Page to Pandoc, applies page transforms, and adds page title.
pageToWikiPandoc :: Page -> ContentTransformer Pandoc

-- | Converts source text to Pandoc using default page type.
pageToPandoc :: Page -> ContentTransformer Pandoc

-- | Converts pandoc document to HTML.
pandocToHtml :: Pandoc -> ContentTransformer Html

-- | Returns highlighted source code.
highlightSource :: Maybe String -> ContentTransformer Html

-- | Applies all the page transform plugins to a Pandoc document.
applyPageTransforms :: Pandoc -> ContentTransformer Pandoc

-- | Puts rendered page content into a wikipage div, adding categories.
wikiDivify :: Html -> ContentTransformer Html

-- | Adds page title to a Pandoc document.
addPageTitleToPandoc :: String -> Pandoc -> ContentTransformer Pandoc

-- | Adds javascript links for math support.
addMathSupport :: a -> ContentTransformer a

-- | Adds javascripts to page layout.
addScripts :: PageLayout -> [String] -> PageLayout
getFileName :: ContentTransformer FilePath
getPageName :: ContentTransformer String
getLayout :: ContentTransformer PageLayout
getParams :: ContentTransformer Params
getCacheable :: ContentTransformer Bool

-- | Derives a URL from a list of Pandoc Inline elements.
inlinesToURL :: [Inline] -> String

-- | Convert a list of inlines into a string.
inlinesToString :: [Inline] -> String


-- | Interface for plugins.
--   
--   A plugin is a Haskell module that is dynamically loaded by gitit.
--   
--   There are three kinds of plugins: <a>PageTransform</a>s,
--   <a>PreParseTransform</a>s, and <a>PreCommitTransform</a>s. These
--   plugins differ chiefly in where they are applied.
--   <a>PreCommitTransform</a> plugins are applied just before changes to a
--   page are saved and may transform the raw source that is saved.
--   <a>PreParseTransform</a> plugins are applied when a page is viewed and
--   may alter the raw page source before it is parsed as a <a>Pandoc</a>
--   document. Finally, <a>PageTransform</a> plugins modify the
--   <a>Pandoc</a> document that results after a page's source is parsed,
--   but before it is converted to HTML:
--   
--   <pre>
--      +--------------------------+
--      | edited text from browser |
--      +--------------------------+
--                   ||         &lt;----  PreCommitTransform plugins
--                   \/
--                   ||         &lt;----  saved to repository
--                   \/
--   +---------------------------------+
--   | raw page source from repository |
--   +---------------------------------+
--                   ||         &lt;----  PreParseTransform plugins
--                   \/
--                   ||         &lt;----  markdown or RST reader
--                   \/
--          +-----------------+
--          | Pandoc document |
--          +-----------------+
--                   ||         &lt;---- PageTransform plugins
--                   \/
--        +---------------------+
--        | new Pandoc document |
--        +---------------------+
--                   ||         &lt;---- HTML writer
--                   \/
--        +----------------------+
--        | HTML version of page |
--        +----------------------+
--   </pre>
--   
--   Note that <a>PreParseTransform</a> and <a>PageTransform</a> plugins do
--   not alter the page source stored in the repository. They only affect
--   what is visible on the website. Only <a>PreCommitTransform</a> plugins
--   can alter what is stored in the repository.
--   
--   Note also that <a>PreParseTransform</a> and <a>PageTransform</a>
--   plugins will not be run when the cached version of a page is used.
--   Plugins can use the <a>doNotCache</a> command to prevent a page from
--   being cached, if their behavior is sensitive to things that might
--   change from one time to another (such as the time or currently
--   logged-in user).
--   
--   You can use the helper functions <a>mkPageTransform</a> and
--   <a>mkPageTransformM</a> to create <a>PageTransform</a> plugins from a
--   transformation of any of the basic types used by Pandoc (for example,
--   <tt>Inline</tt>, <tt>Block</tt>, <tt>[Inline]</tt>, even
--   <tt>String</tt>). Here is a simple (if silly) example:
--   
--   <pre>
--   -- Deprofanizer.hs
--   module Deprofanizer (plugin) where
--   
--   -- This plugin replaces profane words with "XXXXX".
--   
--   import Network.Gitit.Interface
--   import Data.Char (toLower)
--   
--   plugin :: Plugin
--   plugin = mkPageTransform deprofanize
--   
--   deprofanize :: Inline -&gt; Inline
--   deprofanize (Str x) | isBadWord x = Str "XXXXX"
--   deprofanize x                     = x
--   
--   isBadWord :: String -&gt; Bool
--   isBadWord x = (map toLower x) `elem` ["darn", "blasted", "stinker"]
--   -- there are more, but this is a family program
--   </pre>
--   
--   Further examples can be found in the <tt>plugins</tt> directory in the
--   source distribution. If you have installed gitit using Cabal, you can
--   also find them in the directory
--   <tt>CABALDIR/share/gitit-X.Y.Z/plugins</tt>, where <tt>CABALDIR</tt>
--   is the cabal install directory and <tt>X.Y.Z</tt> is the version
--   number of gitit.
module Network.Gitit.Interface
data Plugin
PageTransform :: (Pandoc -> PluginM Pandoc) -> Plugin
PreParseTransform :: (String -> PluginM String) -> Plugin
PreCommitTransform :: (String -> PluginM String) -> Plugin
type PluginM = ReaderT PluginData StateT Context IO

-- | Lifts a function from <tt>a -&gt; a</tt> (for example, <tt>Inline
--   -&gt; Inline</tt>, <tt>Block -&gt; Block</tt>, <tt>[Inline] -&gt;
--   [Inline]</tt>, or <tt>String -&gt; String</tt>) to a
--   <a>PageTransform</a> plugin.
mkPageTransform :: Data a => (a -> a) -> Plugin

-- | Monadic version of <a>mkPageTransform</a>. Lifts a function from <tt>a
--   -&gt; m a</tt> to a <a>PageTransform</a> plugin.
mkPageTransformM :: Data a => (a -> PluginM a) -> Plugin

-- | Data structure for information read from config file.
data Config
Config :: FilePath -> FileStoreType -> PageType -> String -> MathMethod -> Bool -> Bool -> (Handler -> Handler) -> AuthenticationLevel -> Handler -> FilePath -> Int -> FilePath -> FilePath -> Priority -> FilePath -> [String] -> Bool -> Integer -> Integer -> String -> Int -> Bool -> String -> [String] -> [String] -> String -> String -> Maybe (String, [String]) -> Bool -> Bool -> String -> String -> String -> String -> Bool -> Bool -> FilePath -> Map String String -> String -> String -> Text -> Bool -> String -> Bool -> String -> Integer -> Integer -> Maybe FilePath -> Bool -> Int -> GithubConfig -> Config

-- | Path of repository containing filestore
[repositoryPath] :: Config -> FilePath

-- | Type of repository
[repositoryType] :: Config -> FileStoreType

-- | Default page markup type for this wiki
[defaultPageType] :: Config -> PageType

-- | Default file extension for pages in this wiki
[defaultExtension] :: Config -> String

-- | How to handle LaTeX math in pages?
[mathMethod] :: Config -> MathMethod

-- | Treat as literate haskell by default?
[defaultLHS] :: Config -> Bool

-- | Show Haskell code with bird tracks
[showLHSBirdTracks] :: Config -> Bool

-- | Combinator to set <tt>REMOTE_USER</tt> request header
[withUser] :: Config -> Handler -> Handler

-- | Handler for login, logout, register, etc.
[requireAuthentication] :: Config -> AuthenticationLevel

-- | Specifies which actions require authentication.
[authHandler] :: Config -> Handler

-- | Path of users database
[userFile] :: Config -> FilePath

-- | Seconds of inactivity before session expires
[sessionTimeout] :: Config -> Int

-- | Directory containing page templates
[templatesDir] :: Config -> FilePath

-- | Path of server log file
[logFile] :: Config -> FilePath

-- | Severity filter for log messages (DEBUG, INFO, NOTICE, WARNING, ERROR,
--   CRITICAL, ALERT, EMERGENCY)
[logLevel] :: Config -> Priority

-- | Path of static directory
[staticDir] :: Config -> FilePath

-- | Names of plugin modules to load
[pluginModules] :: Config -> [String]

-- | Show table of contents on each page?
[tableOfContents] :: Config -> Bool

-- | Max size of file uploads
[maxUploadSize] :: Config -> Integer

-- | Max size of page uploads
[maxPageSize] :: Config -> Integer

-- | IP address to bind to
[address] :: Config -> String

-- | Port number to serve content on
[portNumber] :: Config -> Int

-- | Print debug info to the console?
[debugMode] :: Config -> Bool

-- | The front page of the wiki
[frontPage] :: Config -> String

-- | Pages that cannot be edited via web
[noEdit] :: Config -> [String]

-- | Pages that cannot be deleted via web
[noDelete] :: Config -> [String]

-- | Default summary if description left blank
[defaultSummary] :: Config -> String

-- | Delete summary
[deleteSummary] :: Config -> String

-- | <tt>Nothing</tt> = anyone can register. <tt>Just (prompt,
--   answers)</tt> = a user will be given the prompt and must give one of
--   the answers to register.
[accessQuestion] :: Config -> Maybe (String, [String])

-- | Disable Registration?
[disableRegistration] :: Config -> Bool

-- | Use ReCAPTCHA for user registration.
[useRecaptcha] :: Config -> Bool
[recaptchaPublicKey] :: Config -> String
[recaptchaPrivateKey] :: Config -> String

-- | RPX domain and key
[rpxDomain] :: Config -> String
[rpxKey] :: Config -> String

-- | Should responses be compressed?
[compressResponses] :: Config -> Bool

-- | Should responses be cached?
[useCache] :: Config -> Bool

-- | Directory to hold cached pages
[cacheDir] :: Config -> FilePath

-- | Map associating mime types with file extensions
[mimeMap] :: Config -> Map String String

-- | Command to send notification emails
[mailCommand] :: Config -> String

-- | Text of password reset email
[resetPasswordMessage] :: Config -> String

-- | Markup syntax help for edit sidebar
[markupHelp] :: Config -> Text

-- | Provide an atom feed?
[useFeed] :: Config -> Bool

-- | Base URL of wiki, for use in feed
[baseUrl] :: Config -> String

-- | Title of wiki, used in feed
[useAbsoluteUrls] :: Config -> Bool

-- | Should WikiLinks be absolute w.r.t. the base URL?
[wikiTitle] :: Config -> String

-- | Number of days history to be included in feed
[feedDays] :: Config -> Integer

-- | Number of minutes to cache feeds before refreshing
[feedRefreshTime] :: Config -> Integer

-- | Directory to search for pandoc customizations
[pandocUserData] :: Config -> Maybe FilePath

-- | Filter HTML through xss-sanitize
[xssSanitize] :: Config -> Bool

-- | The default number of days in the past to look for "recent" activity
[recentActivityDays] :: Config -> Int

-- | Github client data for authentication (id, secret, callback, authorize
--   endpoint, access token endpoint)
[githubAuth] :: Config -> GithubConfig

-- | an HTTP request
data Request
Request :: Bool -> Method -> [String] -> String -> String -> [(String, Input)] -> MVar [(String, Input)] -> [(String, Cookie)] -> HttpVersion -> Headers -> MVar RqBody -> Host -> Request

-- | request uses https://
[rqSecure] :: Request -> Bool

-- | request method
[rqMethod] :: Request -> Method

-- | the uri, split on /, and then decoded
[rqPaths] :: Request -> [String]

-- | the raw rqUri
[rqUri] :: Request -> String

-- | the QUERY_STRING
[rqQuery] :: Request -> String

-- | the QUERY_STRING decoded as key/value pairs
[rqInputsQuery] :: Request -> [(String, Input)]

-- | the request body decoded as key/value pairs (when appropriate)
[rqInputsBody] :: Request -> MVar [(String, Input)]

-- | cookies
[rqCookies] :: Request -> [(String, Cookie)]

-- | HTTP version
[rqVersion] :: Request -> HttpVersion

-- | the HTTP request headers
[rqHeaders] :: Request -> Headers

-- | the raw, undecoded request body
[rqBody] :: Request -> MVar RqBody

-- | (hostname, port) of the client making the request
[rqPeer] :: Request -> Host
data User
User :: String -> Password -> String -> User
[uUsername] :: User -> String
[uPassword] :: User -> Password
[uEmail] :: User -> String
data Context
Context :: String -> PageLayout -> Bool -> Bool -> Bool -> [String] -> [(String, String)] -> Context
[ctxFile] :: Context -> String
[ctxLayout] :: Context -> PageLayout
[ctxCacheable] :: Context -> Bool
[ctxTOC] :: Context -> Bool
[ctxBirdTracks] :: Context -> Bool
[ctxCategories] :: Context -> [String]
[ctxMeta] :: Context -> [(String, String)]
data PageType
Markdown :: PageType
CommonMark :: PageType
RST :: PageType
LaTeX :: PageType
HTML :: PageType
Textile :: PageType
Org :: PageType
DocBook :: PageType
MediaWiki :: PageType

-- | Abstract representation of page layout (tabs, scripts, etc.)
data PageLayout
PageLayout :: String -> Maybe String -> Bool -> [String] -> String -> [String] -> Bool -> Bool -> Maybe Text -> [Tab] -> Tab -> Bool -> PageLayout
[pgPageName] :: PageLayout -> String
[pgRevision] :: PageLayout -> Maybe String
[pgPrintable] :: PageLayout -> Bool
[pgMessages] :: PageLayout -> [String]
[pgTitle] :: PageLayout -> String
[pgScripts] :: PageLayout -> [String]
[pgShowPageTools] :: PageLayout -> Bool
[pgShowSiteNav] :: PageLayout -> Bool
[pgMarkupHelp] :: PageLayout -> Maybe Text
[pgTabs] :: PageLayout -> [Tab]
[pgSelectedTab] :: PageLayout -> Tab
[pgLinkToFeed] :: PageLayout -> Bool

-- | Returns the current wiki configuration.
askConfig :: PluginM Config

-- | Returns <tt>Just</tt> the logged in user, or <tt>Nothing</tt> if
--   nobody is logged in.
askUser :: PluginM (Maybe User)

-- | Returns the complete HTTP request.
askRequest :: PluginM Request

-- | Returns the wiki filestore.
askFileStore :: PluginM FileStore

-- | Returns the page meta data
askMeta :: PluginM [(String, String)]

-- | Indicates that the current page or file is not to be cached.
doNotCache :: PluginM ()
getContext :: HasContext m => m Context
modifyContext :: HasContext m => (Context -> Context) -> m ()

-- | Derives a URL from a list of Pandoc Inline elements.
inlinesToURL :: [Inline] -> String

-- | Convert a list of inlines into a string.
inlinesToString :: [Inline] -> String

-- | Lift a computation from the <a>IO</a> monad. This allows us to run IO
--   computations in any monadic stack, so long as it supports these kinds
--   of operations (i.e. <a>IO</a> is the base monad for the stack).
--   
--   <h3><b>Example</b></h3>
--   
--   <pre>
--   import Control.Monad.Trans.State -- from the "transformers" library
--   
--   printState :: Show s =&gt; StateT s IO ()
--   printState = do
--     state &lt;- get
--     liftIO $ print state
--   </pre>
--   
--   Had we omitted <tt><a>liftIO</a></tt>, we would have ended up with
--   this error:
--   
--   <pre>
--   • Couldn't match type ‘IO’ with ‘StateT s IO’
--    Expected type: StateT s IO ()
--      Actual type: IO ()
--   </pre>
--   
--   The important part here is the mismatch between <tt>StateT s IO
--   ()</tt> and <tt><a>IO</a> ()</tt>.
--   
--   Luckily, we know of a function that takes an <tt><a>IO</a> a</tt> and
--   returns an <tt>(m a)</tt>: <tt><a>liftIO</a></tt>, enabling us to run
--   the program and see the expected results:
--   
--   <pre>
--   &gt; evalStateT printState "hello"
--   "hello"
--   
--   &gt; evalStateT printState 3
--   3
--   </pre>
liftIO :: MonadIO m => IO a -> m a

-- | Perform a function in a temporary directory and clean up.
withTempDir :: FilePath -> (FilePath -> IO a) -> IO a

module Network.Gitit.Authentication.Github
loginGithubUser :: OAuth2 -> Params -> Handler
getGithubUser :: GithubConfig -> GithubCallbackPars -> String -> GititServerPart (Either GithubLoginError User)
data GithubCallbackPars
data GithubLoginError
ghUserMessage :: GithubLoginError -> String
ghDetails :: GithubLoginError -> Maybe String
instance GHC.Classes.Eq Network.Gitit.Authentication.Github.GithubUser
instance GHC.Classes.Eq Network.Gitit.Authentication.Github.GithubUserMail
instance Happstack.Server.RqData.FromData Network.Gitit.Authentication.Github.GithubCallbackPars
instance Data.Aeson.Types.FromJSON.FromJSON Network.Gitit.Authentication.Github.GithubUser
instance Data.Aeson.Types.FromJSON.FromJSON Network.Gitit.Authentication.Github.GithubUserMail
instance GHC.Internal.Show.Show Network.Gitit.Authentication.Github.GithubCallbackPars
instance GHC.Internal.Show.Show Network.Gitit.Authentication.Github.GithubUser
instance GHC.Internal.Show.Show Network.Gitit.Authentication.Github.GithubUserMail

module Network.Gitit.Authentication
loginUserForm :: Handler
formAuthHandlers :: Bool -> [Handler]
httpAuthHandlers :: [Handler]
rpxAuthHandlers :: [Handler]
githubAuthHandlers :: GithubConfig -> [Handler]
instance Happstack.Server.RqData.FromData Network.Gitit.Authentication.RPars
instance GHC.Internal.Read.Read Network.Gitit.Authentication.ValidationType
instance GHC.Internal.Show.Show Network.Gitit.Authentication.RPars
instance GHC.Internal.Show.Show Network.Gitit.Authentication.ValidationType

module Paths_gitit
version :: Version
getBinDir :: IO FilePath
getLibDir :: IO FilePath
getDynLibDir :: IO FilePath
getDataDir :: IO FilePath
getLibexecDir :: IO FilePath
getDataFileName :: FilePath -> IO FilePath
getSysconfDir :: IO FilePath


-- | Functions for initializing a Gitit wiki.
module Network.Gitit.Initialize

-- | Initialize Gitit State.
initializeGititState :: Config -> IO ()

-- | Recompile the page template.
recompilePageTemplate :: IO ()
compilePageTemplate :: FilePath -> IO (StringTemplate String)

-- | Create static directory unless it exists.
createStaticIfMissing :: Config -> IO ()

-- | Create page repository unless it exists.
createRepoIfMissing :: Config -> IO ()
createDefaultPages :: Config -> IO ()

-- | Create templates dir if it doesn't exist.
createTemplateIfMissing :: Config -> IO ()


-- | Functions for creating Atom feeds for Gitit wikis and pages.
module Network.Gitit.Feed
data FeedConfig
FeedConfig :: String -> String -> Integer -> FeedConfig
[fcTitle] :: FeedConfig -> String
[fcBaseUrl] :: FeedConfig -> String
[fcFeedDays] :: FeedConfig -> Integer
filestoreToXmlFeed :: FeedConfig -> FileStore -> Maybe FilePath -> IO String
instance GHC.Internal.Read.Read Network.Gitit.Feed.FeedConfig
instance GHC.Internal.Show.Show Network.Gitit.Feed.FeedConfig

module Network.Gitit.Handlers
handleAny :: Handler
debugHandler :: Handler
randomPage :: Handler
discussPage :: Handler
createPage :: Handler
showActivity :: Handler
goToPage :: Handler
searchResults :: Handler
uploadForm :: Handler
uploadFile :: Handler
indexPage :: Handler
categoryPage :: Handler
categoryListPage :: Handler

-- | Responds with rendered page derived from form data.
preview :: Handler

-- | Converts a <tt>ContentTransformer</tt> into a
--   <tt>GititServerPart</tt>; specialized to wiki pages.
--   runPageTransformer :: ToMessage a =&gt; ContentTransformer a -&gt;
--   GititServerPart a runPageTransformer = runTransformer pathForPage
--   
--   Converts a <tt>ContentTransformer</tt> into a
--   <tt>GititServerPart</tt>; specialized to non-pages. runFileTransformer
--   :: ToMessage a =&gt; ContentTransformer a -&gt; GititServerPart a
--   runFileTransformer = runTransformer id
--   
--   Responds with raw page source.
showRawPage :: Handler

-- | Responds with raw source (for non-pages such as source code files).
showFileAsText :: Handler
showPageHistory :: Handler
showFileHistory :: Handler

-- | Responds with rendered wiki page.
showPage :: Handler
showPageDiff :: Handler
showFileDiff :: Handler
updatePage :: Handler
editPage :: Handler
deletePage :: Handler
confirmDelete :: Handler

-- | Responds with highlighted source code.
showHighlightedSource :: Handler
expireCache :: Handler
feedHandler :: Handler


-- | Functions for parsing command line options and reading the config
--   file.
module Network.Gitit.Config

-- | Get configuration from config file.
getConfigFromFile :: FilePath -> IO Config

-- | Get configuration from config files, or default.
getConfigFromFiles :: [FilePath] -> IO Config

-- | Returns the default gitit configuration.
getDefaultConfig :: IO Config

-- | Read a file associating mime types with extensions, and return a map
--   from extensions to types. Each line of the file consists of a mime
--   type, followed by space, followed by a list of zero or more
--   extensions, separated by spaces. Example: text/plain txt text
readMimeTypesFile :: FilePath -> IO (Map String String)
instance GHC.Internal.Show.Show Network.Gitit.Config.Section


-- | Functions for embedding a gitit wiki into a Happstack application.
--   
--   The following is a minimal standalone wiki program:
--   
--   <pre>
--   import Network.Gitit
--   import Happstack.Server.SimpleHTTP
--   
--   main = do
--     conf &lt;- getDefaultConfig
--     createStaticIfMissing conf
--     createTemplateIfMissing conf
--     createRepoIfMissing conf
--     initializeGititState conf
--     simpleHTTP nullConf{port = 5001} $ wiki conf
--   </pre>
--   
--   Here is a more complex example, which serves different wikis under
--   different paths, and uses a custom authentication scheme:
--   
--   <pre>
--   import Network.Gitit
--   import Control.Monad
--   import Text.XHtml hiding (dir)
--   import Happstack.Server.SimpleHTTP
--   
--   type WikiSpec = (String, FileStoreType, PageType)
--   
--   wikis = [ ("markdownWiki", Git, Markdown)
--           , ("latexWiki", Darcs, LaTeX) ]
--   
--   -- custom authentication
--   myWithUser :: Handler -&gt; Handler
--   myWithUser handler = do
--     -- replace the following with a function that retrieves
--     -- the logged in user for your happstack app:
--     user &lt;- return "testuser"
--     localRq (setHeader "REMOTE_USER" user) handler
--   
--   myAuthHandler = msum
--     [ dir "_login"  $ seeOther "/your/login/url"  $ toResponse ()
--     , dir "_logout" $ seeOther "/your/logout/url" $ toResponse () ]
--   
--   handlerFor :: Config -&gt; WikiSpec -&gt; ServerPart Response
--   handlerFor conf (path', fstype, pagetype) = dir path' $
--     wiki conf{ repositoryPath = path'
--              , repositoryType = fstype
--              , defaultPageType = pagetype}
--   
--   indexPage :: ServerPart Response
--   indexPage = ok $ toResponse $
--     (p &lt;&lt; "Wiki index") +++
--     ulist &lt;&lt; map (\(path', _, _) -&gt; li &lt;&lt; hotlink (path' ++ "/") &lt;&lt; path') wikis
--   
--   main = do
--     conf &lt;- getDefaultConfig
--     let conf' = conf{authHandler = myAuthHandler, withUser = myWithUser}
--     forM wikis $ \(path', fstype, pagetype) -&gt; do
--       let conf'' = conf'{ repositoryPath = path'
--                         , repositoryType = fstype
--                         , defaultPageType = pagetype
--                         }
--       createStaticIfMissing conf''
--       createRepoIfMissing conf''
--     createTemplateIfMissing conf'
--     initializeGititState conf'
--     simpleHTTP nullConf{port = 5001} $
--       (nullDir &gt;&gt; indexPage) `mplus` msum (map (handlerFor conf') wikis)
--   </pre>
module Network.Gitit

-- | Happstack handler for a gitit wiki.
wiki :: Config -> ServerPart Response

-- | Recompiles the gitit templates.
reloadTemplates :: ServerPart Response

-- | Converts a gitit Handler into a standard happstack ServerPart.
runHandler :: WikiState -> Handler -> ServerPart Response
loginUserForm :: Handler
getFileStore :: GititServerPart FileStore
getUser :: String -> GititServerPart (Maybe User)
getConfig :: GititServerPart Config
queryGititState :: MonadIO m => (GititState -> a) -> m a
updateGititState :: MonadIO m => (GititState -> GititState) -> m ()
