gitit 0.7.3.7 → 0.7.3.8
raw patch · 4 files changed
+47/−11 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGES +6/−0
- Network/Gitit/Export.hs +37/−6
- Network/Gitit/Framework.hs +3/−4
- gitit.cabal +1/−1
CHANGES view
@@ -1,3 +1,9 @@+Version 0.7.3.8 released 24 July 2010++* Fixed MathML in Slidy and S5 exports.++* Use languagesByFilename instead of languagesByExtension in isSource.+ Version 0.7.3.7 released 24 July 2010 * Depend on pandoc >= 1.6, highlighting-kate >= 0.2.7.1
Network/Gitit/Export.hs view
@@ -20,11 +20,12 @@ -} module Network.Gitit.Export ( exportFormats ) where-import Text.Pandoc+import Text.Pandoc hiding (HTMLMathMethod(..))+import qualified Text.Pandoc as Pandoc import Text.Pandoc.S5 (s5HeaderIncludes)-import Text.Pandoc.Shared (escapeStringUsing)+import Text.Pandoc.Shared (escapeStringUsing, readDataFile) import Network.Gitit.Server-import Network.Gitit.Framework (pathForPage)+import Network.Gitit.Framework (pathForPage, getWikiBase) import Network.Gitit.Util (withTempDir, readFileUTF8) import Network.Gitit.State (getConfig) import Network.Gitit.Types@@ -112,20 +113,50 @@ respondS5 :: String -> Pandoc -> Handler respondS5 pg doc = do cfg <- getConfig+ base' <- getWikiBase inc <- liftIO $ s5HeaderIncludes (pandocUserData cfg)+ let math = case mathMethod cfg of+ MathML -> Pandoc.MathML Nothing+ WebTeX u -> Pandoc.WebTeX u+ JsMathScript -> Pandoc.JsMath+ (Just $ base' ++ "/js/jsMath/easy/load.js")+ _ -> Pandoc.PlainMath+ variables' <- if mathMethod cfg == MathML+ then do+ s <- liftIO $ readDataFile (pandocUserData cfg) $+ "data"</>"MathMLinHTML.js"+ return [("mathml-script", s),("s5includes",inc)]+ else return [("s5includes",inc)] respondS "s5" "text/html; charset=utf-8" "" writeHtmlString defaultRespOptions{writerSlideVariant = S5Slides- ,writerIncremental = True,- writerVariables = [("s5includes",inc)]}+ ,writerIncremental = True+ ,writerVariables = variables'+ ,writerHTMLMathMethod = math} pg doc respondSlidy :: String -> Pandoc -> Handler respondSlidy pg doc = do+ cfg <- getConfig+ base' <- getWikiBase+ let math = case mathMethod cfg of+ MathML -> Pandoc.MathML Nothing+ WebTeX u -> Pandoc.WebTeX u+ JsMathScript -> Pandoc.JsMath+ (Just $ base' ++ "/js/jsMath/easy/load.js")+ _ -> Pandoc.PlainMath+ variables' <- if mathMethod cfg == MathML+ then do+ s <- liftIO $ readDataFile (pandocUserData cfg) $+ "data"</>"MathMLinHTML.js"+ return [("mathml-script", s)]+ else return [] respondS "slidy" "text/html; charset=utf-8" "" writeHtmlString defaultRespOptions{writerSlideVariant = SlidySlides- ,writerIncremental = True}+ ,writerIncremental = True+ ,writerHTMLMathMethod = math+ ,writerVariables = variables'} pg doc respondTexinfo :: String -> Pandoc -> Handler
Network/Gitit/Framework.hs view
@@ -66,8 +66,8 @@ import Data.ByteString.UTF8 (toString) import Data.ByteString.Lazy.UTF8 (fromString) import Data.Maybe (fromJust)-import Data.List (intercalate, isPrefixOf, isInfixOf, (\\))-import System.FilePath ((<.>), takeExtension)+import Data.List (intercalate, isPrefixOf, isInfixOf)+import System.FilePath ((<.>), takeExtension, takeFileName) import Text.Highlighting.Kate import Text.ParserCombinators.Parsec import Network.URL (decString, encString)@@ -265,8 +265,7 @@ isSourceCode :: String -> Bool isSourceCode path' =- let ext = map toLower $ takeExtension path'- langs = languagesByExtension ext \\ ["Postscript"]+ let langs = languagesByFilename $ takeFileName path' in not . null $ langs -- | Returns encoded URL path for the page with the given name, relative to
gitit.cabal view
@@ -1,5 +1,5 @@ name: gitit-version: 0.7.3.7+version: 0.7.3.8 Cabal-version: >= 1.2 build-type: Simple synopsis: Wiki using happstack, git or darcs, and pandoc.