DEV Community

Maryam
Maryam

Posted on

Introducing tml: Your Text to HTML Command-line Companion

In the world of text and web, a bridge is often needed. Enter tml, a straightforward command-line tool designed to swiftly convert your .txt files into clean HTML documents. Let's dive briefly into its magic.

Getting Started with tml

Installation:

git clone https://github.com/mnajibi/tml.git
cd tml
chmod +x main.py

Usage:

./main.py <path-to-txt-file>

Example:
python main.py examples/sample3.txt

Key Features

  • Batch Conversion: Hand over a directory, and tml will process all .txt files within.
  • Automatic Formatting: Your text paragraphs? They'll be neatly wrapped in <p>...</p> tags.
  • Title Recognition: A title followed by two blank lines in your .txt? tml sets it as the HTML <title> and creates a bold <h1> tag in the body.
  • Custom Output Directory: Specify where you want your .html files with: ./main.py <path-to-txt-file> --output <path-to-output-directory> Example: python main.py examples/sample3.txt --output ./custom

Wrap Up

tml brings simplicity and efficiency to your text-to-HTML needs. No fuss, no clutter, just pure conversion. Curious? Dive into the project on GitHub for more.

Top comments (0)