Library that generates HTML output from JSON export of tiptap editor
Project description
Tiptapy
Library that generates HTML output from JSON export of tiptap editor
Install
pip install tiptapy
Usage
import tiptapy
s = """
{
"type": "doc",
"content": [
{
"type": "blockquote",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Readability counts."
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"marks": [
{
"type": "link",
"attrs": { "href": "https://en.wikipedia.org/wiki/Zen_of_Python" }
}
],
"text": "Zen of Python"
},
{
"type": "text", "text": " By "
},
{
"type": "text",
"marks": [
{
"type": "bold"
}
],
"text": "Tom Peters"
}
]
}
]
}
]
}
"""
out = tiptapy.to_html(s)
print(out)
Output
<blockquote>
<p>Readability counts.</p>
<p>
<a href="https://en.wikipedia.org/wiki/Zen_of_Python">Zen of Python</a> By
<strong>Tom Peters</strong>
</p>
</blockquote>
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
tiptapy-0.9.0.tar.gz
(6.6 kB
view details)
File details
Details for the file tiptapy-0.9.0.tar.gz
.
File metadata
- Download URL: tiptapy-0.9.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 885291b46107eb20abafc7124ff2d299f6fac09e7b4302178026bf86fe995c71 |
|
MD5 | 18b1c9a87a0d1dafe329fdb68bd5f4a9 |
|
BLAKE2b-256 | 357c89613e7d82ff92e7cad2b44496d011fb4c0b004197d3e1f0afea6324d8b4 |