ecifl2html¶
ecifl2html is a Python package for converting formatted text to HTML. It is a simple package that provides a single class, FormattedTextToHTML, used to convert formatted text to HTML.
Below, you can find more information on the FormattedTextToHTML class source code.
Usage¶
## Usage
To use ecifl2html you first have your formatted text in the following format:
### Example Formatted Text
from src.ecifl2html import ecifl2html as hw
formatted_text = """
h. Welcome to FormattedTextToHTML
p. Convert formatted text into HTML effortlessly.
hh. Features
#. Supports headers (e.g., h., hh., hhh.)
#. Paragraphs (e.g., p.)
#. Ordered lists (#.)
#. Unordered lists (-.)
#. Code blocks (```...```)
hh. Example
p. Here's a code block:
r```
def example():
return “Hello, FormattedTextToHTML!”
r```
"""
converter = ht.FormattedTextToHTML(formatted_text)
html_output = converter.convert()
print(html_output)
NB: the r in code block section is there for the sake of the formatted text, so in your formatted text omit the r.
The expected HTML output will be: