git.iko.soy/typeable/pandoc
on master help sign in
Fixed up LaTeXMathML module not to use TH.
f36ce01fiddlosopher
src/Text/Pandoc/LaTeXMathML.hs−3
@@ -6,11 +6,8 @@ import Text.Pandoc.Shared (readDataFile)
6
6
7-- | String containing LaTeXMathML javascript.
7-- | String containing LaTeXMathML javascript.
8latexMathMLScript :: IO String
8latexMathMLScript :: IO String
9−latexMathMLScript = undefined
10−{-
11latexMathMLScript = do
9latexMathMLScript = do
12 jsCom <- readDataFile $ "data" </> "LaTeXMathML.js.comment"
10 jsCom <- readDataFile $ "data" </> "LaTeXMathML.js.comment"
13 jsPacked <- readDataFile $ "data" </> "LaTeXMathML.js.packed"
11 jsPacked <- readDataFile $ "data" </> "LaTeXMathML.js.packed"
14 return $ "<script type=\"text/javascript\">\n" ++ jsCom ++ jsPacked ++
12 return $ "<script type=\"text/javascript\">\n" ++ jsCom ++ jsPacked ++
15 "</script>\n"
13 "</script>\n"
16−-}
src/pandoc.hs+10−3
@@ -34,6 +34,7 @@ import Text.Pandoc
34import Text.Pandoc.ODT
34import Text.Pandoc.ODT
35import Text.Pandoc.Writers.S5 (s5HeaderIncludes)
35import Text.Pandoc.Writers.S5 (s5HeaderIncludes)
36import Text.Pandoc.Templates (getDefaultTemplate)
36import Text.Pandoc.Templates (getDefaultTemplate)
37+import Text.Pandoc.LaTeXMathML (latexMathMLScript)
37import Text.Pandoc.Shared ( HTMLMathMethod (..), tabFilter, ObfuscationMethod (..) )
38import Text.Pandoc.Shared ( HTMLMathMethod (..), tabFilter, ObfuscationMethod (..) )
38#ifdef _HIGHLIGHTING
39#ifdef _HIGHLIGHTING
39import Text.Pandoc.Highlighting ( languages )
40import Text.Pandoc.Highlighting ( languages )
@@ -261,8 +262,8 @@ options =
261
262
262 , Option "m" ["latexmathml", "asciimathml"]
263 , Option "m" ["latexmathml", "asciimathml"]
263 (OptArg
264 (OptArg
265+ (\arg opt ->
264− (\arg opt -> return opt { optHTMLMathMethod =
266+ return opt { optHTMLMathMethod = LaTeXMathML arg })
265− LaTeXMathML arg })
266 "URL")
267 "URL")
267 "" -- "Use LaTeXMathML script in html output"
268 "" -- "Use LaTeXMathML script in html output"
268
269
@@ -641,6 +642,12 @@ main = do
641 variables
642 variables
642 else return variables
643 else return variables
643
644
645+ variables'' <- case mathMethod of
646+ LaTeXMathML (Just _) -> do
647+ s <- latexMathMLScript
648+ return $ ("latexmathml-script", s) : variables'
649+ _ -> return variables'
650+
644 let startParserState =
651 let startParserState =
645 defaultParserState { stateParseRaw = parseRaw,
652 defaultParserState { stateParseRaw = parseRaw,
646 stateTabStop = tabStop,
653 stateTabStop = tabStop,
@@ -660,7 +667,7 @@ main = do
660 writerTemplate = if null template
667 writerTemplate = if null template
661 then defaultTemplate
668 then defaultTemplate
662 else template,
669 else template,
663− writerVariables = variables',
670+ writerVariables = variables'',
664 writerIncludeBefore = concat befores,
671 writerIncludeBefore = concat befores,
665 writerIncludeAfter = concat afters,
672 writerIncludeAfter = concat afters,
666 writerTabStop = tabStop,
673 writerTabStop = tabStop,
templates/html.template+7−1
@@ -7,7 +7,13 @@
7 /><meta name="generator" content="pandoc"
7 /><meta name="generator" content="pandoc"
8 /><meta name="author" content="$authors$"
8 /><meta name="author" content="$authors$"
9 /><meta name="date" content="$date$"
9 /><meta name="date" content="$date$"
10+ />
11+ $if(latexmathml-script)$
12+ $latexmathml-script$
13+ $endif$
10− />$header-includes$
14+ $if(header-includes)$
15+ $header-includes$
16+ $endif$
11</head
17</head
12 ><body
18 ><body
13 >
19 >
templates/latex.template+2
@@ -33,7 +33,9 @@ $if(numbersections)$
33$else$
33$else$
34\setcounter{secnumdepth}{0}
34\setcounter{secnumdepth}{0}
35$endif$
35$endif$
36+$if(header-includes)$
36$header-includes$
37$header-includes$
38+$endif$
37
39
38$if(title)$
40$if(title)$
39\title{$title$}
41\title{$title$}