DEV Community

WangGithub0
WangGithub0

Posted on

convertTxtToHtml - A new command-line tool can process .txt files into .html

In today's digital age, creating web content is more accessible than ever. Whether you're a blogger, a developer, or simply someone looking to share information online, converting text to HTML is a common task. To simplify this process, I'm thrilled to introduce our new tool, "convertTxtToHtml."

Installation

  1. Download and Install Java Development Kit according to the Oracle JDK Installation Guide.

  2. Clone this repository to your local machine

git clone git@github.com:WangGithub0/ConvertTxtToHtml.git
cd ConvertTxtToHtml

  1. Add executable permission to the ConvertTxtToHtml.java file chmod +x src/ConvertTxtToHtml.java

Examples

java src/ConvertTxtToHtml.java ./examples

Command Options:

  • --help or -h: Display help information.
  • --version or -v: Display the tool's version.
  • path: Specify the path to a .txt file or a directory containing multiple .txt files. If a directory is provided, tml will recursively process all .txt files within.
  • --output or -o: Specify a custom output directory. The tool will create the directory if it does not exist.

Features

  • Converts single or multiple .txt files to .html.
  • Same directory structure in output directory.
  • Allow to specify a different output directory.
  • Automatically parsing title from .txt file.

Github

https://github.com/WangGithub0/ConvertTxtToHtml

Top comments (0)