git.iko.soy/typeable/pandoc
on master help sign in
Fixed up LaTeXMathML module not to use TH.

Instead, we read the script in pandoc.hs, and pass it via variables. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1702 788f1e2b-df1e-0410-8736-df70ead52e1b

commitf36ce015c4ba1d638f3b4009419f11c3d5ffa768 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateThu 31 Dec 2009, 01:13 (17 years ago) parentb7750b7
4 files changed+19−7
src/Text/Pandoc/LaTeXMathML.hs−3 src/pandoc.hs+10−3 templates/html.template+7−1 templates/latex.template+2
src/Text/Pandoc/LaTeXMathML.hs−3
@@ -6,11 +6,8 @@ import Text.Pandoc.Shared (readDataFile)
66
77-- | String containing LaTeXMathML javascript.
88latexMathMLScript :: IO String
9−latexMathMLScript = undefined
10−{-
119latexMathMLScript = do
1210 jsCom <- readDataFile $ "data" </> "LaTeXMathML.js.comment"
1311 jsPacked <- readDataFile $ "data" </> "LaTeXMathML.js.packed"
1412 return $ "<script type=\"text/javascript\">\n" ++ jsCom ++ jsPacked ++
1513 "</script>\n"
16−-}
src/pandoc.hs+10−3
@@ -34,6 +34,7 @@ import Text.Pandoc
3434import Text.Pandoc.ODT
3535import Text.Pandoc.Writers.S5 (s5HeaderIncludes)
3636import Text.Pandoc.Templates (getDefaultTemplate)
37+import Text.Pandoc.LaTeXMathML (latexMathMLScript)
3738import Text.Pandoc.Shared ( HTMLMathMethod (..), tabFilter, ObfuscationMethod (..) )
3839#ifdef _HIGHLIGHTING
3940import Text.Pandoc.Highlighting ( languages )
@@ -261,8 +262,8 @@ options =
261262
262263 , Option "m" ["latexmathml", "asciimathml"]
263264 (OptArg
264− (\arg opt -> return opt { optHTMLMathMethod =
265− LaTeXMathML arg })
265+ (\arg opt ->
266+ return opt { optHTMLMathMethod = LaTeXMathML arg })
266267 "URL")
267268 "" -- "Use LaTeXMathML script in html output"
268269
@@ -641,6 +642,12 @@ main = do
641642 variables
642643 else return variables
643644
645+ variables'' <- case mathMethod of
646+ LaTeXMathML (Just _) -> do
647+ s <- latexMathMLScript
648+ return $ ("latexmathml-script", s) : variables'
649+ _ -> return variables'
650+
644651 let startParserState =
645652 defaultParserState { stateParseRaw = parseRaw,
646653 stateTabStop = tabStop,
@@ -660,7 +667,7 @@ main = do
660667 writerTemplate = if null template
661668 then defaultTemplate
662669 else template,
663− writerVariables = variables',
670+ writerVariables = variables'',
664671 writerIncludeBefore = concat befores,
665672 writerIncludeAfter = concat afters,
666673 writerTabStop = tabStop,
templates/html.template+7−1
@@ -7,7 +7,13 @@
77 /><meta name="generator" content="pandoc"
88 /><meta name="author" content="$authors$"
99 /><meta name="date" content="$date$"
10− />$header-includes$
10+ />
11+ $if(latexmathml-script)$
12+ $latexmathml-script$
13+ $endif$
14+ $if(header-includes)$
15+ $header-includes$
16+ $endif$
1117</head
1218 ><body
1319 >
templates/latex.template+2
@@ -33,7 +33,9 @@ $if(numbersections)$
3333$else$
3434\setcounter{secnumdepth}{0}
3535$endif$
36+$if(header-includes)$
3637$header-includes$
38+$endif$
3739
3840$if(title)$
3941\title{$title$}