Pandoc in WebAssembly (Try It)
git clone https://github.com/y-taka-23/wasm-pandoc.git
cd wasm-pandoc
make start
Pandoc compiled into WebAssembly by Asterius. π
Home Page: https://y-taka-23.github.io/wasm-pandoc/
License: BSD 3-Clause "New" or "Revised" License
git clone https://github.com/y-taka-23/wasm-pandoc.git
cd wasm-pandoc
make start
Is it technically possible to compile it enabling citeproc (which is integrated)? And external filters (like pandoc-crossref)?
Impressive work, by the way.
Itβs amazing that someone compiled Pandoc to WebAssembly! Have you considered creating an npm package for it?
β wasm-pandoc git:(main) β cabal update
Downloading the latest package list from hackage.haskell.org
Updated package list of hackage.haskell.org to the index-state 2022-03-13T09:59:08Z
β wasm-pandoc git:(main) β cabal install
cabal: Could not resolve dependencies:
[__0] trying: wasm-pandoc-0.1.0.0 (user goal)
[__1] unknown package: asterius-prelude (dependency of wasm-pandoc)
[__1] fail (backjumping, conflict set: asterius-prelude, wasm-pandoc)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: wasm-pandoc, asterius-prelude
hi
can you add support for org format?
thanks
replace 'docker run ' to 'podman run' in Makefile and type make start
, get error 'no space left on device'.
console detail
wasm-pandoc git:(main) β make start
podman run --rm -v /Users/xxx/code/test/wasm-pandoc:/workspace -w /workspace terrorjack/asterius \
ahc-cabal install \
--builddir _build/ahc-cabal --installdir _build \
--install-method copy --overwrite-policy always
Resolving "terrorjack/asterius" using unqualified-search registries (/etc/containers/registries.conf.d/999-podman-machine.conf)
Trying to pull docker.io/terrorjack/asterius:latest...
Getting image source signatures
Copying blob sha256:972d552e121bdc57dc4153bf43e513f26bad0d29b128c4a8526decb212038747
Copying blob sha256:202e395991f57f0835b7d65ed999a31de118bbe18e4624d575597730800c95db
Copying blob sha256:840f69ab81c8b6eae57982901c6aa91041eb768ae2965d715f2dbc17bf888a92
Copying blob sha256:972d552e121bdc57dc4153bf43e513f26bad0d29b128c4a8526decb212038747
Error: writing blob: adding layer with blob "sha256:972d552e121bdc57dc4153bf43e513f26bad0d29b128c4a8526decb212038747": Error processing tar file(exit status 1): write /root/.asterius/.stack-work/install/x86_64-linux-tinfo6/3445437948fd86ce7ef120ae609b3b54e4a1ea68fb09256c10b6b2a6394fb17d/8.8.4/share/x86_64-linux-ghc-8.8.4/asterius-0.0.1/.boot/asterius_lib/lib/x86_64-linux-ghc-8.8.4/amazonka-cloudsearch-1.6.1-4tsRzvJUAIQCe8Gm7ym9wI/libHSamazonka-cloudsearch-1.6.1-4tsRzvJUAIQCe8Gm7ym9wI.a: no space left on device
make: *** [compile] Error 125
I try to convert docx to html and get errors from terminal, eg. 'JavaScript heap out of memory'.
btw, I convert T.Text to T.Text, like markdown to html, is successfulοΌand I convert BSL.ByteString to T.Text is block by (reader def input)
example code: https://github.com/pasicopan/wasm-pandoc
detail:
// modify Main.hs
convertFromTo :: T.Text -> String -> BSL.ByteString -> Maybe T.Text
convertFromTo from to input =
case runPure $ (getReader from) of
Left err -> error (show err)
Right (ByteStringReader reader, es) -> case runPure $ reader def input of
Left err -> error (show err)
Right doc -> case runPure $ (writerOf to) def doc of
Left err -> error (show err)
Right output -> Just output
convert :: JSString -> JSString -> JSUint8Array -> JSString
convert from to =
textToJSString
. fromMaybe (T.pack "")
. convertFromTo (textFromJSString from) (fromJSString to)
. BSL.fromStrict
. byteStringFromJSUint8Array
foreign export javascript "convert" convert :: JSString -> JSString -> JSUint8Array -> JSString
index.js:1 PandocParseError "No entry on path: META-INF/container.xml"
CallStack (from HasCallStack):
error, called at app/Main.hs:36:26 in main:Main
f @ index.js:1
await in f (async)
(anonymous) @ VM4305:1
index.js:1 Uncaught RangeError: Offset is outside the bounds of the DataView
at DataView.getBigUint64 (<anonymous>)
at st.i64Load (index.js:1)
at yt.evacuateClosure (index.js:1)
at yt.scavengeStackChunk (index.js:1)
at yt.scavengeClosure (index.js:1)
at yt.scavengeLoop (index.js:1)
at yt.performGC (index.js:1)
at ht.returnedFromTSO (index.js:1)
at ht.tick (index.js:1)
at index.js:1
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x10837c815 node::Abort() (.cold.1) [/Users/xxx/.nvm/versions/node/v16.13.1/bin/node]
2: 0x10707baa9 node::Abort() [/Users/xxx/.nvm/versions/node/v16.13.1/bin/node]
3: 0x10707bc1f node::OnFatalError(char const*, char const*) [/Users/xxx/.nvm/versions/node/v16.13.1/bin/node]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.