ghcjs-commonjs/examples/pandoc
2016-06-23 02:24:54 -03:00
..
hs Add initial pandoc example 2016-06-22 16:58:45 -03:00
js Add initial pandoc example 2016-06-22 16:58:45 -03:00
.babelrc Start trying to add pandoc example 2016-06-22 16:58:45 -03:00
ghcjs-commonjs-pandoc.cabal Add initial pandoc example 2016-06-22 16:58:45 -03:00
index.html Start trying to add pandoc example 2016-06-22 16:58:45 -03:00
LICENSE Start trying to add pandoc example 2016-06-22 16:58:45 -03:00
main-comp.min.js.gz Add initial pandoc example 2016-06-22 16:58:45 -03:00
main.min.js Add initial pandoc example 2016-06-22 16:58:45 -03:00
Makefile Add initial pandoc example 2016-06-22 16:58:45 -03:00
node-main.js Update with pandoc Node.js easy running 2016-06-22 17:05:04 -03:00
out.min.bad.js Add initial pandoc example 2016-06-22 16:58:45 -03:00
out.min.js Add initial pandoc example 2016-06-22 16:58:45 -03:00
package.json Example fixes 2016-06-23 02:24:54 -03:00
README.md Update webpack example 2016-06-22 17:21:21 -03:00
screenshot.png Update pandoc example 2016-06-22 17:19:45 -03:00
Setup.hs Start trying to add pandoc example 2016-06-22 16:58:45 -03:00
stack.yaml Example fixes 2016-06-23 02:24:54 -03:00
webpack.config.js Start trying to add pandoc example 2016-06-22 16:58:45 -03:00

ghcjs-commonjs-pandoc

GHCJS CommonJS pandoc example.

Building

Running:

npm install

Will install dependencies. To build you can run:

npm run build

Running

The generated code should be executable in Node.js, but only the Node.js build has been tested. Usage is:

  • Compile with stack build
  • node node-main.js
const ghcjsRequire = require('ghcjs-require');
const Main = ghcjsRequire(module, 'ghcjs-commonjs-pandoc');
Main(({ wrapped }) => {
  wrapped.convert('markdown', 'html', '# Hello World')
    .then((res) => console.log(res));
});

Build Time

After 50m I managed to get a runnable on browser output from webpack, by increasing the maximum heap size to 8GB.