diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-11-07 13:05:06 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-11-07 13:05:06 -0800 |
commit | 5a4c0d6a8cf7e15ec1d871fee641ffcc063ef89a (patch) | |
tree | f227fb0f462a0716c20c6e6c8d211fadcce60c26 /src | |
parent | f0182e1cb57ca1e7f0b60781b83e387675c4e611 (diff) | |
download | pandoc-5a4c0d6a8cf7e15ec1d871fee641ffcc063ef89a.tar.gz |
Deprecated ancient HTML math methods.
`--latexmathml`,
`--gladtex`,
`--mimetex`,
`--jsmath`
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/App.hs | 62 |
1 files changed, 38 insertions, 24 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index e82ccf3f0..d9924d3a1 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -1401,29 +1401,12 @@ options = (\opt -> return opt { optCiteMethod = Biblatex })) "" -- "Use biblatex cite commands in LaTeX output" - , Option "m" ["latexmathml", "asciimathml"] - (OptArg - (\arg opt -> - return opt { optHTMLMathMethod = LaTeXMathML arg }) - "URL") - "" -- "Use LaTeXMathML script in html output" - , Option "" ["mathml"] (NoArg (\opt -> return opt { optHTMLMathMethod = MathML })) "" -- "Use mathml for HTML math" - , Option "" ["mimetex"] - (OptArg - (\arg opt -> do - let url' = case arg of - Just u -> u ++ "?" - Nothing -> "/cgi-bin/mimetex.cgi?" - return opt { optHTMLMathMethod = WebTeX url' }) - "URL") - "" -- "Use mimetex for HTML math" - , Option "" ["webtex"] (OptArg (\arg opt -> do @@ -1432,12 +1415,6 @@ options = "URL") "" -- "Use web service for HTML math" - , Option "" ["jsmath"] - (OptArg - (\arg opt -> return opt { optHTMLMathMethod = JsMath arg}) - "URL") - "" -- "Use jsMath for HTML math" - , Option "" ["mathjax"] (OptArg (\arg opt -> do @@ -1446,6 +1423,7 @@ options = return opt { optHTMLMathMethod = MathJax url'}) "URL") "" -- "Use MathJax for HTML math" + , Option "" ["katex"] (OptArg (\arg opt -> @@ -1455,9 +1433,38 @@ options = "URL") "" -- Use KaTeX for HTML Math + , Option "m" ["latexmathml", "asciimathml"] + (OptArg + (\arg opt -> do + deprecatedOption "--latexmathml" + return opt { optHTMLMathMethod = LaTeXMathML arg }) + "URL") + "" -- "Use LaTeXMathML script in html output" + + , Option "" ["mimetex"] + (OptArg + (\arg opt -> do + deprecatedOption "--mimetex" + let url' = case arg of + Just u -> u ++ "?" + Nothing -> "/cgi-bin/mimetex.cgi?" + return opt { optHTMLMathMethod = WebTeX url' }) + "URL") + "" -- "Use mimetex for HTML math" + + , Option "" ["jsmath"] + (OptArg + (\arg opt -> do + deprecatedOption "--jsmath" + return opt { optHTMLMathMethod = JsMath arg}) + "URL") + "" -- "Use jsMath for HTML math" + , Option "" ["gladtex"] (NoArg - (\opt -> return opt { optHTMLMathMethod = GladTeX })) + (\opt -> do + deprecatedOption "--gladtex" + return opt { optHTMLMathMethod = GladTeX })) "" -- "Use gladtex for HTML math" , Option "" ["abbreviations"] @@ -1655,3 +1662,10 @@ splitField s = baseWriterName :: String -> String baseWriterName = takeWhile (\c -> c /= '+' && c /= '-') + +deprecatedOption :: String -> IO () +deprecatedOption o = + runIO (report $ Deprecated o "") >>= + \r -> case r of + Right () -> return () + Left e -> E.throwIO e |