Giter Site home page Giter Site logo

1mr-newton / flet_highlighter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benitmulindwa/fletifyhtml

1.0 0.0 1.0 58 KB

FletifyHTML is a versatile Python tool designed to convert HTML content into Flet code.

License: MIT License

Python 100.00%

flet_highlighter's Introduction

FletifyHTML

FletifyHTML 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,...)

pip install fletify

Alternative

Install via Github and use the example.py to test Fletify

pip install git+https://github.com/Benitmulindwa/FletifyHTML.git

Usage

from fletify 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

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:

<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 file for details.

flet_highlighter's People

Contributors

benitmulindwa avatar ipcloudlive avatar

Stargazers

IdiotCodes avatar

Forkers

kawsar992

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.