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
Built Distribution
File details
Details for the file jupyter_anywidget_pandoc-0.0.3.tar.gz
.
File metadata
- Download URL: jupyter_anywidget_pandoc-0.0.3.tar.gz
- Upload date:
- Size: 66.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e13ffb95a8194809f440840bc2c71c8f7c9e91592b79fd670b9f72fae6a1f012 |
|
MD5 | 1acf9834ba8f40ba19d2b5f50b2ccd67 |
|
BLAKE2b-256 | 08aab961955c3ade12ac156d3e3c0ad9230e50b68308260dc35d295ce6e4b52c |
File details
Details for the file jupyter_anywidget_pandoc-0.0.3-py2.py3-none-any.whl
.
File metadata
- Download URL: jupyter_anywidget_pandoc-0.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 68.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb51d279c5ea6904073bde5b27245ec09e72f68a0d0511196b47c8c70beafdc9 |
|
MD5 | 2ebbbeccf01a135c5af13c425be22141 |
|
BLAKE2b-256 | dec32ddf70a287ee614492568b4eb9ad65078202a3c41846e949f9f74dbc8aa2 |