tiptapy


Nametiptapy JSON
Version 0.20.0 PyPI version JSON
download
home_pagehttps://github.com/scrolltech/tiptapy
SummaryLibrary that generates HTML output from JSON export of tiptap editor
upload_time2024-06-14 10:36:25
maintainerNone
docs_urlNone
authorShekhar Tiwatne
requires_pythonNone
licensehttp://www.opensource.org/licenses/mit-license.php
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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}
<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>
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/scrolltech/tiptapy",
    "name": "tiptapy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Shekhar Tiwatne",
    "author_email": "pythonic@gmail.com",
    "download_url": null,
    "platform": null,
    "description": "# Tiptapy\n### Library that generates HTML output from JSON export of tiptap editor \n\n![tiptapy](https://github.com/scrolltech/tiptapy/workflows/tiptapy/badge.svg)\n\n### Install \n\n\n```bash\npip install tiptapy\n```\n\n### Test\n\n```bash\npython -m pytest\n```\n\n### Usage\n\n``` {.sourceCode .python}\nimport tiptapy\n\ns = \"\"\"\n\n{\n  \"type\": \"doc\",\n  \"content\": [\n    {\n      \"type\": \"blockquote\",\n      \"content\": [\n        {\n          \"type\": \"paragraph\",\n          \"content\": [\n            {\n              \"type\": \"text\",\n              \"text\": \"Readability counts.\"\n            }\n          ]\n        },\n        {\n          \"type\": \"paragraph\",\n          \"content\": [\n            {\n              \"type\": \"text\",\n              \"marks\": [\n                {\n                  \"type\": \"link\",\n                  \"attrs\": { \"href\": \"https://en.wikipedia.org/wiki/Zen_of_Python\" }\n                }\n              ],\n              \"text\": \"Zen of Python\"\n            },\n            {\n              \"type\": \"text\", \"text\": \" By \"\n            },\n            {\n              \"type\": \"text\",\n              \"marks\": [\n                {\n                  \"type\": \"bold\"\n                }\n              ],\n              \"text\": \"Tom Peters\"\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}\n\"\"\"\n\nclass config:\n    \"\"\"\n    Config class to store constants used by the other nodes.\n    \"\"\"\n    DOMAIN = \"python.org\"\n\n\nrenderer = tiptapy.BaseDoc(config)\nout = renderer.render(s)\nprint(out)\n```\n\n#### Output\n``` {.sourceCode .html}\n<blockquote>\n  <p>Readability counts.</p>\n  <p>\n      <a href=\"https://en.wikipedia.org/wiki/Zen_of_Python\">Zen of Python</a> By \n      <strong>Tom Peters</strong>\n  </p>\n</blockquote>\n```\n",
    "bugtrack_url": null,
    "license": "http://www.opensource.org/licenses/mit-license.php",
    "summary": "Library that generates HTML output from JSON export of tiptap editor",
    "version": "0.20.0",
    "project_urls": {
        "Homepage": "https://github.com/scrolltech/tiptapy"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7a0447e908bc9510b8deef8e597d897d2997d898e19c8ade2d38bb841b57279a",
                "md5": "c90e3d9755eed0fc55a2cdc00f1d70ed",
                "sha256": "e3443bde43cc23f4cd4249ed772f2a2f03a4f19b1d11fee8277bc6a43ec2ef3b"
            },
            "downloads": -1,
            "filename": "tiptapy-0.20.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c90e3d9755eed0fc55a2cdc00f1d70ed",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 16489,
            "upload_time": "2024-06-14T10:36:25",
            "upload_time_iso_8601": "2024-06-14T10:36:25.726004Z",
            "url": "https://files.pythonhosted.org/packages/7a/04/47e908bc9510b8deef8e597d897d2997d898e19c8ade2d38bb841b57279a/tiptapy-0.20.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-14 10:36:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "scrolltech",
    "github_project": "tiptapy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tiptapy"
}
        
Elapsed time: 0.86929s