# MyFletifyHTML
MyFletifyHTML is a Python package for converting HTML content into Flet code. It allows you to embed HTML code in your Flet app
## Installation
### (Not avalaible for now,...)
```bash
pip install fletify
```
### Alternative
Install via Github and use the `example.py` to test Fletify
```bash
pip install git+https://github.com/tct123/MyFletifyHTML.git
```
## Usage
```python
import flet as ft
from myfletify import FletifyHTML
# Example HTML content
html_content = "<p>This is a <b>paragraph</b> with <a href='#'>a link</a></p>"
# Create a FletifyHTML instance
fletify = FletifyHTML(html_content)
# Get the Flet code
flet_code = fletify.get_flet()
def main(page: ft.Page):
#Display the output, by adding it on the page
page.add(flet_code)
page.update()
ft.app(target=main)
```
# OutPut:
![test1](test1.PNG)
`FletifyHTML()` can receive the HTML file containing the content to be displayed, `FletifyHTML(html=<path-to-your-html-file>)`
## Features
For now, **Fletify** support the following HTML tags:
`img`, `ul`, `ol`, `li`, `a`, `b`, `strong`, `i`, `em`, `u`, `mark`, `span`, `div`, `p`, `code`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `table`, `tr`, `th`, `td`
Fletify doesn't support CSS style however, it supports inline style using the `style` attribute.
#### eg:
```html
<img style="width: 200; height: 200; background-color:yellow; border-radius: 5; border: 3 solid #336699; margin:40" src="https://picsum.photos/200/200?10" alt="Example Image">
```
these are the supported style properties
`color`, `background-color`, `font-family`, `font-size`, `text-align`, `text-decoration`, `display`, `justify-content`, `margin`, `padding`, `border-radius`, `border`, `width`, `height`
## Contributing
If you'd like to contribute to FletifyHTML, please open an issue or submit a pull request.
🚨 Give FletifyHTML a try and tell us what you think about it.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/tct123/MyFletifyHTML",
"name": "myfletify",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "tct123",
"author_email": "42028373+tct123@users.noreply.github.com",
"download_url": "https://files.pythonhosted.org/packages/2c/78/6a6c8172ec4b949d4f98342e2f3a5fe49074c767e521872863e7805fb827/myfletify-0.1.0.tar.gz",
"platform": null,
"description": "# MyFletifyHTML\n\nMyFletifyHTML is a Python package for converting HTML content into Flet code. It allows you to embed HTML code in your Flet app\n\n## Installation\n### (Not avalaible for now,...) \n```bash\npip install fletify\n```\n### Alternative\nInstall via Github and use the `example.py` to test Fletify\n\n```bash\npip install git+https://github.com/tct123/MyFletifyHTML.git\n```\n## Usage\n```python\nimport flet as ft\nfrom myfletify import FletifyHTML\n\n# Example HTML content\nhtml_content = \"<p>This is a <b>paragraph</b> with <a href='#'>a link</a></p>\"\n\n# Create a FletifyHTML instance\nfletify = FletifyHTML(html_content)\n\n# Get the Flet code\nflet_code = fletify.get_flet()\n\ndef main(page: ft.Page):\n\n #Display the output, by adding it on the page \n page.add(flet_code)\n page.update()\n\nft.app(target=main)\n```\n# OutPut:\n![test1](test1.PNG)\n\n`FletifyHTML()` can receive the HTML file containing the content to be displayed, `FletifyHTML(html=<path-to-your-html-file>)` \n\n## Features\n\nFor now, **Fletify** support the following HTML tags:\n\n`img`, `ul`, `ol`, `li`, `a`, `b`, `strong`, `i`, `em`, `u`, `mark`, `span`, `div`, `p`, `code`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `table`, `tr`, `th`, `td`\nFletify doesn't support CSS style however, it supports inline style using the `style` attribute.\n#### eg:\n```html\n<img style=\"width: 200; height: 200; background-color:yellow; border-radius: 5; border: 3 solid #336699; margin:40\" src=\"https://picsum.photos/200/200?10\" alt=\"Example Image\">\n```\nthese are the supported style properties\n`color`, `background-color`, `font-family`, `font-size`, `text-align`, `text-decoration`, `display`, `justify-content`, `margin`, `padding`, `border-radius`, `border`, `width`, `height`\n\n## Contributing\nIf you'd like to contribute to FletifyHTML, please open an issue or submit a pull request.\n\n\ud83d\udea8 Give FletifyHTML a try and tell us what you think about it.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": null,
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/tct123/MyFletifyHTML",
"Repository": "https://github.com/tct123/MyFletifyHTML"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "12d4f0e6182dd902a3b3a247d687b8442c7fd3eeb8d6aae9e17e71964c4b0b17",
"md5": "5ec020985ed7709ce26599f2cdc47882",
"sha256": "b6582c637e6bc083caf654443f2d61703954122c90ae1b54b01f5f73979cced4"
},
"downloads": -1,
"filename": "myfletify-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5ec020985ed7709ce26599f2cdc47882",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 7060,
"upload_time": "2024-12-06T09:05:40",
"upload_time_iso_8601": "2024-12-06T09:05:40.843633Z",
"url": "https://files.pythonhosted.org/packages/12/d4/f0e6182dd902a3b3a247d687b8442c7fd3eeb8d6aae9e17e71964c4b0b17/myfletify-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2c786a6c8172ec4b949d4f98342e2f3a5fe49074c767e521872863e7805fb827",
"md5": "6d79b412a737f7cd944589b6f88dd63b",
"sha256": "801bc28dac1583c4b1eea6ef545ef27d136290bb11df6d1850bcf3747123efec"
},
"downloads": -1,
"filename": "myfletify-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "6d79b412a737f7cd944589b6f88dd63b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 6081,
"upload_time": "2024-12-06T09:05:42",
"upload_time_iso_8601": "2024-12-06T09:05:42.125524Z",
"url": "https://files.pythonhosted.org/packages/2c/78/6a6c8172ec4b949d4f98342e2f3a5fe49074c767e521872863e7805fb827/myfletify-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-06 09:05:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tct123",
"github_project": "MyFletifyHTML",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "myfletify"
}