Skip to content

Commit 43f2f40

Browse files
committed
chore: add readme/license
1 parent 925eb8f commit 43f2f40

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Tweag I/O Limited.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# `pandoc-wasm`
2+
3+
[![Chat on Matrix](https://matrix.to/img/matrix-badge.svg)](https://matrix.to/#/#haskell-wasm:matrix.terrorjack.com)
4+
5+
The latest version of `pandoc` CLI compiled as a standalone
6+
`wasm32-wasi` module that can be run by engines like `wasmtime` as
7+
well as browsers.
8+
9+
## [Live demo](https://tweag.github.io/pandoc-wasm)
10+
11+
Stdin on the left, stdout on the right, command line arguments at the
12+
bottom. No convert button, output is produced dynamically as input
13+
changes.
14+
15+
You're also more than welcome to fetch the
16+
[`pandoc.wasm`](https://tweag.github.io/pandoc-wasm/pandoc.wasm)
17+
module and make your own customized app. `pandoc.wasm` is fully
18+
`wasm32-wasi` compliant and doesn't make use of any JSFFI feature in
19+
the ghc wasm backend.
20+
21+
## Building
22+
23+
`pandoc.wasm` is built with 9.12 flavour of ghc wasm backend in CI,
24+
which can be installed via
25+
[`ghc-wasm-meta`](https://gitlab.haskell.org/ghc/ghc-wasm-meta). You
26+
need at least 9.10 since it's the earliest major version with (my
27+
non-official) backports for ghc wasm backend's Template Haskell & ghci
28+
support.
29+
30+
It's built using my
31+
[fork](https://github.com/TerrorJack/pandoc/tree/wasm) which is based
32+
on latest `pandoc` release and patches dependencies, cabal config as
33+
well as some module code to make things compilable to wasm:
34+
35+
- No http client/server functionality. `wasip1` doesn't have proper
36+
sockets support anyway, and support for future versions of wasi is
37+
not on my radar for now.
38+
- No lua support. lua requires `setjmp`/`longjmp` which already work
39+
in `wasi-libc` to some extent, but that requires wasm exception
40+
handling feature which is not supported by `wasmtime` yet.
41+
42+
Other functionalities should just work, if not feel free to file a bug
43+
report :)
44+
45+
## Acknowledgements
46+
47+
Thanks to John MacFarlane and all the contributors who made `pandoc`
48+
possible: a fantastic tool that has benefited many developers and is a
49+
source of pride for the Haskell community!
50+
51+
Thanks to all past efforts of using `asterius` to compile `pandoc` to
52+
wasm, including but not limited to:
53+
54+
- George Stagg's [`pandoc-wasm`](https://github.com/georgestagg/pandoc-wasm)
55+
- Yuto Takahashi's [`wasm-pandoc`](https://github.com/y-taka-23/wasm-pandoc)
56+
- My legacy asterius pandoc [demo](https://asterius.netlify.app/demo/pandoc/pandoc.html)

0 commit comments

Comments
 (0)