gitit 0.10.6.3 → 0.10.7
raw patch · 11 files changed
+84/−19 lines, 11 filesdep ~aesondep ~highlighting-katedep ~pandocPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson, highlighting-kate, pandoc, zlib
API changes (from Hackage documentation)
+ Network.Gitit.Interface: CommonMark :: PageType
+ Network.Gitit.Types: CommonMark :: PageType
Files
- CHANGES +17/−0
- Network/Gitit/Config.hs +9/−1
- Network/Gitit/ContentTransformer.hs +12/−1
- Network/Gitit/Export.hs +10/−0
- Network/Gitit/Initialize.hs +9/−2
- Network/Gitit/Page.hs +6/−3
- Network/Gitit/Plugins.hs +3/−1
- Network/Gitit/Types.hs +8/−1
- README.markdown +2/−2
- data/default.conf +2/−2
- gitit.cabal +6/−6
CHANGES view
@@ -1,3 +1,20 @@+Version 0.10.7 released 02 Jun 2015++ * Fixes to allow building with pandoc 1.14. `CommonMark` added+ as a constructor of `PageType`. CommonMark can now be used as+ a page format and is also available for page export.+ * Plugins: added some recommended option flags.+ * Allow `---` as well as `...` to end metadata (#493).+ * README: changed dead links (Rick Hanson).++Version 0.10.6.3 released 08 May 2015++ * README: use shortcut style markdown links.+ * Fixed profiling options.+ * Added .travis.yml.+ * Allow both time >= 1.5.0.0 and time < 1.5.0.0 with old-locale+ (Michal Antkiewicz)+ Version 0.10.6.2 released 02 April 2015 * Bumped upper version bounds.
Network/Gitit/Config.hs view
@@ -46,6 +46,13 @@ import Control.Monad import Control.Monad.Trans +#if MIN_VERSION_pandoc(1,14,0)+import Text.Pandoc.Error (handleError)+#else+handleError :: Pandoc -> Pandoc+handleError = id+#endif+ forceEither :: Show e => Either e a -> a forceEither = either (error . show) id @@ -132,7 +139,8 @@ let (pt, lhs) = parsePageType cfDefaultPageType let markupHelpFile = show pt ++ if lhs then "+LHS" else "" markupHelpPath <- liftIO $ getDataFileName $ "data" </> "markupHelp" </> markupHelpFile- markupHelpText <- liftM (writeHtmlString def . readMarkdown def) $+ markupHelpText <- liftM (writeHtmlString def . handleError .+ readMarkdown def) $ liftIO $ readFileUTF8 markupHelpPath mimeMap' <- liftIO $ readMimeTypesFile cfMimeTypesFile
Network/Gitit/ContentTransformer.hs view
@@ -107,6 +107,12 @@ import qualified Text.Pandoc as Pandoc import Text.URI (parseURI, URI(..), uriQueryItems) +#if MIN_VERSION_pandoc(1,14,0)+import Text.Pandoc.Error (handleError)+#else+handleError :: Pandoc -> Pandoc+handleError = id+#endif -- -- ContentTransformer runners --@@ -672,9 +678,14 @@ else readerExtensions def , readerParseRaw = True }- in case pt of+ in handleError . case pt of RST -> readRST defPS Markdown -> readMarkdown defPS+#if MIN_VERSION_pandoc(1,14,0)+ CommonMark -> readCommonMark defPS+#else+ CommonMark -> error "CommonMark input requires pandoc 1.14"+#endif LaTeX -> readLaTeX defPS HTML -> readHtml defPS Textile -> readTextile defPS
Network/Gitit/Export.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {- Copyright (C) 2009 John MacFarlane <jgm@berkeley.edu> @@ -161,6 +162,12 @@ respondMarkdown = respondS "markdown" "text/plain; charset=utf-8" "" writeMarkdown defaultRespOptions{writerReferenceLinks = True} +#if MIN_VERSION_pandoc(1,14,0)+respondCommonMark :: String -> Pandoc -> Handler+respondCommonMark = respondS "commonmark" "text/plain; charset=utf-8" ""+ writeCommonMark defaultRespOptions{writerReferenceLinks = True}+#endif+ respondPlain :: String -> Pandoc -> Handler respondPlain = respondS "plain" "text/plain; charset=utf-8" "" writePlain defaultRespOptions@@ -284,6 +291,9 @@ , ("Texinfo", respondTexinfo) , ("reST", respondRST) , ("Markdown", respondMarkdown)+#if MIN_VERSION_pandoc(1,14,0)+ , ("CommonMark",respondCommonMark)+#endif , ("Plain text",respondPlain) , ("MediaWiki", respondMediaWiki) , ("Org-mode", respondOrg)
Network/Gitit/Initialize.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {- Copyright (C) 2009 John MacFarlane <jgm@berkeley.edu> This program is free software; you can redistribute it and/or modify@@ -42,6 +43,13 @@ import System.Log.Logger (logM, Priority(..)) import qualified Text.StringTemplate as T +#if MIN_VERSION_pandoc(1,14,0)+import Text.Pandoc.Error (handleError)+#else+handleError :: Pandoc -> Pandoc+handleError = id+#endif+ -- | Initialize Gitit State. initializeGititState :: Config -> IO () initializeGititState conf = do@@ -118,8 +126,7 @@ createDefaultPages conf = do let fs = filestoreFromConfig conf pt = defaultPageType conf- toPandoc = readMarkdown- def{ readerSmart = True }+ toPandoc = handleError . readMarkdown def{ readerSmart = True } defOpts = def{ writerStandalone = False , writerHTMLMathMethod = JsMath (Just "/js/jsMath/easy/load.js")
Network/Gitit/Page.hs view
@@ -76,12 +76,15 @@ pMetadataBlock = try $ do _ <- string "---" _ <- pBlankline- ls <- many pMetadataLine- _ <- string "..."- _ <- pBlankline+ ls <- manyTill pMetadataLine pMetaEnd skipMany pBlankline rest <- getInput return (ls, rest)++pMetaEnd :: GenParser Char st Char+pMetaEnd = try $ do+ string "..." <|> string "---"+ pBlankline pBlankline :: GenParser Char st Char pBlankline = try $ many (oneOf " \t") >> newline
Network/Gitit/Plugins.hs view
@@ -37,7 +37,9 @@ logM "gitit" WARNING ("Loading plugin '" ++ pluginName ++ "'...") runGhc (Just libdir) $ do dflags <- getSessionDynFlags- setSessionDynFlags dflags+ setSessionDynFlags $ dflags{ hscTarget = HscInterpreted+ , ghcLink = LinkInMemory+ , ghcMode = CompManager } defaultCleanupHandler dflags $ do -- initDynFlags unless ("Network.Gitit.Plugin." `isPrefixOf` pluginName)
Network/Gitit/Types.hs view
@@ -83,7 +83,14 @@ import Data.Char (isSpace) import Network.OAuth.OAuth2 -data PageType = Markdown | RST | LaTeX | HTML | Textile | Org | DocBook+data PageType = Markdown+ | CommonMark+ | RST+ | LaTeX+ | HTML+ | Textile+ | Org+ | DocBook | MediaWiki deriving (Read, Show, Eq)
README.markdown view
@@ -54,8 +54,8 @@ [GHC]: http://www.haskell.org/ghc/ [here]: http://www.haskell.org/ghc/-[cabal-install]: http://hackage.haskell.org/trac/hackage/wiki/CabalInstall-[quick install]: http://hackage.haskell.org/trac/hackage/wiki/CabalInstall#Quick+Installation+on+Unix+[cabal-install]: https://wiki.haskell.org/Cabal-Install+[quick install]: https://wiki.haskell.org/Cabal-Install#Unix Once you've got cabal-install, installing gitit is trivial:
data/default.conf view
@@ -57,8 +57,8 @@ default-page-type: Markdown # specifies the type of markup used to interpret pages in the wiki.-# Possible values are Markdown, RST, LaTeX, HTML, Markdown+LHS, RST+LHS,-# LaTeX+LHS, DocBook, Org. (The +LHS variants treat the input as+# Possible values are Markdown, CommonMark, RST, LaTeX, HTML, Markdown+LHS,+# RST+LHS, LaTeX+LHS, DocBook, Org. (The +LHS variants treat the input as # literate Haskell. See pandoc's documentation for more details.) If # Markdown is selected, pandoc's syntax extensions (for footnotes, # delimited code blocks, etc.) will be enabled. Note that pandoc's
gitit.cabal view
@@ -1,5 +1,5 @@ name: gitit-version: 0.10.6.3+version: 0.10.7 Cabal-version: >= 1.6 build-type: Simple synopsis: Wiki using happstack, git or darcs, and pandoc.@@ -130,7 +130,7 @@ exposed-modules: Network.Gitit.Interface build-depends: ghc, ghc-paths cpp-options: -D_PLUGINS- build-depends: base >= 3, pandoc >= 1.12.4 && < 1.14,+ build-depends: base >= 3, pandoc >= 1.12.4 && < 1.15, pandoc-types >= 1.12.3 && < 1.13, filepath, safe extensions: CPP if impl(ghc >= 6.12)@@ -147,14 +147,14 @@ pretty, xhtml, containers,- pandoc >= 1.12.4 && < 1.14,+ pandoc >= 1.12.4 && < 1.15, pandoc-types >= 1.12.3 && < 1.13, process, filepath, directory, mtl, old-time,- highlighting-kate >= 0.5.0.1 && < 0.6,+ highlighting-kate >= 0.5.0.1 && < 0.7, bytestring, text, random,@@ -166,7 +166,7 @@ time >= 1.1 && < 1.6, recaptcha >= 0.1, filestore >= 0.6 && < 0.7,- zlib >= 0.5 && < 0.6,+ zlib >= 0.5 && < 0.7, url >= 2.1 && < 2.2, happstack-server >= 7.0 && < 7.5, base64-bytestring >= 0.1 && < 1.1,@@ -183,7 +183,7 @@ hoauth2 >= 0.4.2 && < 0.5, http-conduit >= 2.1.4 && < 2.2, http-client-tls >= 0.2.2 && < 0.3,- aeson >= 0.7 && < 0.9,+ aeson >= 0.7 && < 0.10, uuid >= 1.3 && < 1.4 if impl(ghc >= 6.10) build-depends: base >= 4, syb