aboutsummaryrefslogtreecommitdiff
path: root/trypandoc
diff options
context:
space:
mode:
Diffstat (limited to 'trypandoc')
-rw-r--r--trypandoc/Makefile2
-rw-r--r--trypandoc/index.html2
-rw-r--r--trypandoc/trypandoc.hs13
3 files changed, 11 insertions, 6 deletions
diff --git a/trypandoc/Makefile b/trypandoc/Makefile
index c486aea3b..f5f6046b1 100644
--- a/trypandoc/Makefile
+++ b/trypandoc/Makefile
@@ -1,5 +1,5 @@
CGIBIN=/home/website/cgi-bin
-TRYPANDOC=/home/website/html/pandoc/try/
+TRYPANDOC=/home/website/pandoc.org/try/
CGI=${CGIBIN}/trypandoc
BIN=/home/jgm/.local/bin/trypandoc
diff --git a/trypandoc/index.html b/trypandoc/index.html
index 26a373112..fe4077ce2 100644
--- a/trypandoc/index.html
+++ b/trypandoc/index.html
@@ -88,11 +88,13 @@ $(document).ready(function() {
<option value="markdown_github">Markdown (GitHub)</option>
<option value="mediawiki">MediaWiki</option>
<option value="markdown_mmd">MultiMarkdown</option>
+ <option value="muse">Muse</option>
<option value="opml">OPML</option>
<option value="org">Org Mode</option>
<option value="rst">reStructuredText</option>
<option value="textile">Textile</option>
<option value="t2t">Txt2Tags</option>
+ <option value="vimwiki">Vimwiki</option>
</select>
<br/>
<textarea id="text" maxlength="3000" rows="15"></textarea>
diff --git a/trypandoc/trypandoc.hs b/trypandoc/trypandoc.hs
index d8652079a..5a4828877 100644
--- a/trypandoc/trypandoc.hs
+++ b/trypandoc/trypandoc.hs
@@ -3,15 +3,15 @@ module Main where
import Network.Wai.Handler.CGI
import Network.Wai
import Control.Applicative ((<$>))
-import Data.Maybe (mapMaybe, fromMaybe)
+import Data.Maybe (fromMaybe)
import Network.HTTP.Types.Status (status200)
import Network.HTTP.Types.Header (hContentType)
import Network.HTTP.Types.URI (queryToQueryText)
import Text.Pandoc
+import Text.Pandoc.Writers.Math (defaultMathJaxURL)
import Text.Pandoc.Highlighting (pygments)
import Text.Pandoc.Readers (getReader, Reader(..))
import Text.Pandoc.Writers (getWriter, Writer(..))
-import Text.Pandoc.Error (PandocError)
import Text.Pandoc.Shared (tabFilter)
import Data.Aeson
import qualified Data.Text as T
@@ -29,11 +29,13 @@ app req respond = do
fromFormat <- fromMaybe "" <$> getParam "from"
toFormat <- fromMaybe "" <$> getParam "to"
let reader = case getReader (T.unpack fromFormat) of
- Right (TextReader r) -> r readerOpts
+ Right (TextReader r, es) -> r readerOpts{
+ readerExtensions = es }
_ -> error $ "could not find reader for "
++ T.unpack fromFormat
let writer = case getWriter (T.unpack toFormat) of
- Right (TextWriter w) -> w writerOpts
+ Right (TextWriter w, es) -> w writerOpts{
+ writerExtensions = es }
_ -> error $ "could not find writer for " ++
T.unpack toFormat
let result = case runPure $ reader (tabFilter 4 text) >>= writer of
@@ -56,7 +58,8 @@ checkLength t =
writerOpts :: WriterOptions
writerOpts = def { writerReferenceLinks = True,
writerEmailObfuscation = NoObfuscation,
- writerHTMLMathMethod = MathJax "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML",
+ writerHTMLMathMethod = MathJax (defaultMathJaxURL ++
+ "MathJax.js?config=TeX-AMS_CHTML-full"),
writerHighlightStyle = Just pygments }
readerOpts :: ReaderOptions