Python port of the quill.js delta library that enables operational transformation with aditional functionality for rendering html
Project description
Delta (Python Port)
Python port of the javascript Delta library for QuillJS: https://github.com/quilljs/delta
Some basic pythonizing has been done, but mostly it works exactly like the above library.
There is no other python specific documentation at this time, sorry. Please see the tests for reference examples.
Rendering HTML in Python
This library includes a module delta.html
that renders html from an operation list,
allowing you to render Quill Delta operations in full from a Python server.
For example:
from delta import html
ops = [
{ "insert":"Quill\nEditor\n\n" },
{ "insert": "bold",
"attributes": {"bold": True}},
{ "insert":" and the " },
{ "insert":"italic",
"attributes": { "italic": True }},
{ "insert":"\n\nNormal\n" },
]
html.render(ops)
Result (line formatting added for readability):
<p>Quill</p>
<p>Editor</p>
<p><br></p>
<p><strong>bold</strong> and the <em>italic</em></p>
<p><br></p>
<p>Normal</p>
See test_html.py for more examples.
Developing
Tests
> python setup.py test
or
> py.test
Project details
Release history Release notifications | RSS feed
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
Hashes for quill_delta-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfccb95c8be322e83906aab1542fb9a01692f500ec701ea2c8f17e5d98c80fb5 |
|
MD5 | 8b98ca58064367b43c6bb9723f7cff65 |
|
BLAKE2b-256 | 695da5feeea9a9a9827220dd0d60c5e5faa55af0b3bd7447440825519256c844 |