Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stckme/tiptapy
Library that generates HTML output from JSON export of tiptap editor
https://github.com/stckme/tiptapy
json-to-html tiptap-editor
Last synced: about 17 hours ago
JSON representation
Library that generates HTML output from JSON export of tiptap editor
- Host: GitHub
- URL: https://github.com/stckme/tiptapy
- Owner: stckme
- License: mit
- Created: 2019-12-20T06:24:13.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-14T09:18:56.000Z (8 months ago)
- Last Synced: 2025-02-03T06:47:49.144Z (8 days ago)
- Topics: json-to-html, tiptap-editor
- Language: HTML
- Size: 240 KB
- Stars: 45
- Watchers: 9
- Forks: 13
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-tiptap - Python Library that converts Tiptap JSON
- awesome-tiptap - Python Library that converts Tiptap JSON
README
# Tiptapy
### Library that generates HTML output from JSON export of tiptap editor![tiptapy](https://github.com/scrolltech/tiptapy/workflows/tiptapy/badge.svg)
### Install
```bash
pip install tiptapy
```### Test
```bash
python -m pytest
```### Usage
``` {.sourceCode .python}
import tiptapys = """
{
"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"
}
]
}
]
}
]
}
"""class config:
"""
Config class to store constants used by the other nodes.
"""
DOMAIN = "python.org"renderer = tiptapy.BaseDoc(config)
out = renderer.render(s)
print(out)
```#### Output
``` {.sourceCode .html}
Readability counts.
Zen of Python By
Tom Peters
```