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.4.tar.gz (66.4 kB view details)

Uploaded Source

Built Distribution

jupyter_anywidget_pandoc-0.0.4-py2.py3-none-any.whl (68.6 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for jupyter_anywidget_pandoc-0.0.4.tar.gz
Algorithm Hash digest
SHA256 50470f8629b98048c19696c0955646e09c3dc2ee549ef0e1f80032f90edd7c57
MD5 c6abe00f5a7faf5a95c6d76e4779168d
BLAKE2b-256 6720f31146bc8b9597ccddc6c26bd940e9c512d616d9cd789a501b1a954202be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jupyter_anywidget_pandoc-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8e90d62ec69d53b531f79ec2dfd266553734c0ca5bfa0185c03188d518456d89
MD5 5338f8a30ed8ce9f2010f19f518d3a27
BLAKE2b-256 79ee32cfeadb1eb1a301ed4d641add134c31b6787f2703d6eb2e2a0b7989f628

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