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.

    h2. Features
    #. Supports headers (e.g., h., hh., hhh.)
    #. Paragraphs (e.g., p.)
    #. Ordered lists (#.)
    #. Unordered lists (-.)
    #. Code blocks (```...```)

    h2. 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.2.tar.gz (8.3 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.2-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ecifl2html-0.0.2.tar.gz
  • Upload date:
  • Size: 8.3 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.2.tar.gz
Algorithm Hash digest
SHA256 7be1a28bd053992259f53522a62feec21bc01d1e9f274b29446c69519b71b78d
MD5 11d3d3be94d2a09ecbd19e30740c5064
BLAKE2b-256 564e3132fc4a23b33396b4b196b15195bf201c3da196439863686f7bb79acff5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ecifl2html-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5e4055814a65ac29ad348a4b3653a3eec5b494dbf4e4b0d2c0914b3bb07cd101
MD5 ea0f9235e5b2e9ece1bc03ea3de781fc
BLAKE2b-256 4ed8c9f9f9ad42c10444026bf941e1ce86451c25ff2cc0a3fc8280c53af28c71

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