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-0.0.3.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

ecifl2html-0.0.3-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file ecifl2html-0.0.3.tar.gz.

File metadata

  • Download URL: ecifl2html-0.0.3.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for ecifl2html-0.0.3.tar.gz
Algorithm Hash digest
SHA256 902abdd669b2f4cc54fad8bc5417ce445db1454b7fe7daf31815de47e48efe07
MD5 64dba0d1bbdd298f59a80c0a86d57120
BLAKE2b-256 1bfc5a6c99e66745edafe857a5758f974c0b807df14723d3dfee58a0c4df2f73

See more details on using hashes here.

File details

Details for the file ecifl2html-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ecifl2html-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for ecifl2html-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bf45b23576a57a9a4525d9be126a1d66663b90b399f44a3b72febcdffb762654
MD5 09623dc5fa3af0013b58a09ef89136e0
BLAKE2b-256 3700776f9be18c2ea0ae39606725a70c79c7cfc47ddd1b54c7412330a7f25558

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