Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

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 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"
}
]
}
]
}
]
}
"""

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



```