Skip to main content

A lightweight Python package for adding converting Markdown to HTML.

Project description

ecifl2HTML

GitHub license GitHub release (latest by date) GitHub issues GitHub pull requests GitHub contributors GitHub last commit GitHub commit activity GitHub top language GitHub search hit counter GitHub stars GitHub watchers

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 Continuous-Integration
Deployment Suite Continuous-Deployment
Sphinx Documentation Sphinx-docs
Guard Main Branch Guard Main Branch
Code Quality Checker Lint Codebase

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ecifl2html-1.0.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ecifl2html-1.0.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

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

Hashes for ecifl2html-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d9ebfff48cb37c39f468889f967de86a9d47d88cf09fd063881ebbab4c84c39d
MD5 faa73186309ebd5e9f6b30cd4195e4e4
BLAKE2b-256 f33280edf34c110a29738d714f2310b7ba58820d468f674e5e8df32a611d616d

See more details on using hashes here.

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

Hashes for ecifl2html-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57a5ebbb6be586a91db545ef83a446e9f5806eeab0308258f71d5c54cd1ae684
MD5 048f4d11bef134037fa6e29efd8b9d04
BLAKE2b-256 321c86a82b503a89677db80030f178ddbb38888d612e920c77adaf934fd2f2b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page