Skip to main content

Jupyter anywidget for sideloading pandoc wasm

Project description

jupyter_anywidget_pandoc

Example Jupyter anywidget that will sideload georgestagg/pandoc-wasm into the browser and support pandoc conversions using it.

For example:

from jupyter_anywidget_pandoc import pandoc_headless

# Load the headless widget
p = pandoc_headless()

# Wait for pandoc wasm to load (blocking;; does not work in JupyterLite)
p.ready()

# Try a conversion
# This is blocking - does not work in JupyterLite
output = p.convert("## Some markdown\nWith *feeling...*")
output
> '<h2 id="some-markdown">Some markdown</h2>\n<p>With <em>feeling…</em></p>'

#Non-blocking
p.base_convert("## Some markdown\nWith *feeling...*")
# When it's ready, collect from:
p.response
> {'status': 'processing'}
> {'status': 'completed', 'output_raw': '<p>Another example</p>'}

Use p.convert_from_file(path, output_format="markdown", timeout=3) etc. to load from a local file path or a URL. If no input_format= is specified, the function will attempt to identify the input file type from a file suffix in the path.

Installation

pip install jupyter_anywidget_pandoc

or with uv:

uv add jupyter_anywidget_pandoc

Open example.ipynb in JupyterLab, VS Code, for a demo...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyter_anywidget_pandoc-0.0.2.tar.gz (66.3 kB view details)

Uploaded Source

Built Distribution

jupyter_anywidget_pandoc-0.0.2-py2.py3-none-any.whl (68.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file jupyter_anywidget_pandoc-0.0.2.tar.gz.

File metadata

File hashes

Hashes for jupyter_anywidget_pandoc-0.0.2.tar.gz
Algorithm Hash digest
SHA256 62cf384e9813e3fee1ce6392a9636875227d70b8ca119f0c7804cfa9c05ba74f
MD5 e8e7cf457a93f4a2dd939ef81e46518e
BLAKE2b-256 88b4e1bf693c025733b533e1229d43233ff1b206af9b6455157f5a3c0deb7059

See more details on using hashes here.

File details

Details for the file jupyter_anywidget_pandoc-0.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_anywidget_pandoc-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2ee2be54bd72ec1d0ff81221bd1f337c35157c30771696532baa3f617a51e92e
MD5 964a4ad0db159ec866851af42bf94dd9
BLAKE2b-256 4e469a15a2685a986ae5ae7819843e0615b129a38592c1a3632fe41e53e77fc1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page