* nitmd
* txtmark 0.11 (https://github.com/rjeschke/txtmark)
* markdown4j 2.2 (https://code.google.com/p/markdown4j/)
+* pandoc (last version installed from `cabal`)
## Benches
}
bench_markdown4j
+function bench_pandoc()
+{
+ name="$FUNCNAME"
+ skip_test "$name" && return
+ prepare_res $outdir/pandoc.dat "pandoc" "pandoc"
+ for file in $bncdir/*.md; do
+ name=`basename $file .md`
+ bench_command "$bench" "" "$engdir/pandoc/pandoc" "$file" "$s"
+ done
+}
+bench_pandoc
+
if test "$#" -gt 0; then
plot $outdir/bench_markdown.gnu
fi
# See the License for the specific language governing permissions and
# limitations under the License.
-all: nitmd/nitmd txtmark/Txtmark.class markdown4j/Markdown4j.class
+all: nitmd/nitmd txtmark/Txtmark.class markdown4j/Markdown4j.class pandoc/pandoc
nitmd/nitmd:
make -C nitmd
markdown4j/Markdown4j.class:
make -C markdown4j
+pandoc/pandoc:
+ make -C pandoc
+
clean:
make -C nitmd clean
make -C txtmark clean
make -C markdown4j clean
+ make -C pandoc clean
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2015 Alexandre Terrasa <alexandre@moz-code.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+pandoc:
+ cabal install pandoc
+ ghc pandoc.hs -O
+
+test: pandoc
+ ./pandoc ../../benches/hello.md 5
+
+clean:
+ rm pandoc.hi
+ rm pandoc.o
+ rm pandoc
--- /dev/null
+module Main where
+
+ import System.Environment (getArgs)
+ import Text.Pandoc
+
+ -- Reads a String and parses it as a Pandoc instance
+ readDoc :: String -> Pandoc
+ readDoc = readMarkdown def
+
+ -- Writes a Pandoc instances as a String
+ writeDoc :: Pandoc -> String
+ writeDoc = writeHtmlString def
+
+ -- Reads markdown, writes HTML and prints it in stdout
+ doBench :: String -> IO ()
+ doBench fileName = do
+ content <- readFile fileName
+ let markdown = readDoc content
+ let html = writeDoc markdown
+ print html
+
+ -- Executes `doBench` n times
+ loop :: Int -> String -> IO ()
+ loop 0 _ = return ()
+ loop n fileName = do
+ doBench fileName
+ loop (n - 1) fileName
+ return ()
+
+ main :: IO ()
+ main = do
+ (fileName:count:_) <- getArgs
+ loop (read count::Int) fileName
--- /dev/null
+# Copyright 2013 Alexandre Terrasa <alexandre@moz-code.org>.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+all: run
+
+run: hello_world.jar
+ java -jar hello_world.jar
+
+hello_world.jar: nitj
+ NIT_DIR= ./nitj ../examples/hello_world.nit
+
+nitj:
+ NIT_DIR= ./nitg ../src/nitj.nit
+
+clean:
+ rm -rf -- hello_world.jar .nit_jcompile 2> /dev/null || true