A lightweight Python package for adding converting Markdown to HTML.
Project description
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.
Project Status
Here's the current status of our workflows:
| Workflow | Status |
|---|---|
| Testing Suite | |
| Deployment Suite | |
| Sphinx Documentation | |
| Guard Main Branch | |
| Code Quality Checker |
Components
The ecifl2HTML's codebase structure is as shown below:
.
├── LICENSE
├── MANIFEST.in
├── README.md
├── VERSION
├── build_docs
│ ├── __init__.py
│ └── src
│ ├── __init__.py
│ ├── conf.py
│ ├── index.rst
│ └── ecifl2html.rst
├── requirements
│ ├── production.txt
│ ├── staging.txt
│ └── testing.txt
├── requirements.txt
├── setup.py
└── src
├── ecifl2html
│ ├── __init__.py
│ └── ecifl2html.py
└── tests
├── __init__.py
└── test_ecifl2html.py
Usage
To use ecifl2HTML you first have your Markdown text in the following format:
| Formatted Text | HTML Equivalent |
|---|---|
h., hh. etc. |
<h1>, <h2>, ... |
p. |
<p> |
#. |
<ol> |
-. |
<ul> |
... |
<pre><code> |
i. |
<img> |
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.MarkdownToHTML(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:
<h1>Welcome to FormattedTextToHTML</h1>
<p>Convert formatted text into HTML effortlessly.</p>
<h2>Features</h2>
<ol>
<li>Supports headers (e.g., h., hh., hhh.)</li>
<li>Paragraphs (e.g., p.)</li>
<li>Ordered lists (#.)</li>
<li>Unordered lists (-.)</li>
<li>Code blocks (```...```)</li>
</ol>
<h2>Example</h2>
<p>Here's a code block:</p>
<pre><code>
def example():
return "Hello, FormattedTextToHTML!"
</code></pre>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ecifl2html-1.0.0.tar.gz.
File metadata
- Download URL: ecifl2html-1.0.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9ebfff48cb37c39f468889f967de86a9d47d88cf09fd063881ebbab4c84c39d
|
|
| MD5 |
faa73186309ebd5e9f6b30cd4195e4e4
|
|
| BLAKE2b-256 |
f33280edf34c110a29738d714f2310b7ba58820d468f674e5e8df32a611d616d
|
File details
Details for the file ecifl2html-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ecifl2html-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57a5ebbb6be586a91db545ef83a446e9f5806eeab0308258f71d5c54cd1ae684
|
|
| MD5 |
048f4d11bef134037fa6e29efd8b9d04
|
|
| BLAKE2b-256 |
321c86a82b503a89677db80030f178ddbb38888d612e920c77adaf934fd2f2b4
|