DEV Community

mismathh
mismathh

Posted on

My First Open-Source Project: TILerator

TILerator is a command-line tool that will be able to convert .txt files into .html files. This tool uses JavaScript and Node.js to process files that are located at the file path given. The file path can either point to a singular file, or it can be a directory path that contains multiple .txt files. I will provide a brief description about the tool's features and how to use it, but more information about this tool can be found here: TILerator.

Installation

Clone repository and install

git clone https://github.com/mismathh/TILerator.git
cd TILerator
npm install -g .
Enter fullscreen mode Exit fullscreen mode

Node.js and npm must be installed on your system

Usage/Examples

TILerator [flag] <filePath | directoryPath>
Enter fullscreen mode Exit fullscreen mode

Pass in a flag

TILerator <flag>

--> TILerator -v
Enter fullscreen mode Exit fullscreen mode

Pass in a file path or directory path

TILerator <filePath | directoryPath>

--> TILerator ./examples/example1.txt
Enter fullscreen mode Exit fullscreen mode

Use the -o or --output flag to generate html files in a custom folder

---> TILerator ./examples/til_Sample.txt -o ./htmlFiles
Enter fullscreen mode Exit fullscreen mode

Features

  • Provide --version or -v flag to view version
  • Provide --help or -h flag to view help/usage message
  • Provide a path for a file to generate an html file
  • Provide a path for a directory to generate html files for each text file
  • Adds HTML markup tags such as <p>...</p> to text
  • Outputs files to ./til folder by default
  • Parses title from text file to enhance HTML with <h1>...</h1> markup tags
  • Allows a custom output folder path to be passed using --output or -o flag

Flags

Flag Description
-v, --version Displays version of tool
-h, --help Display help/usage menu
-o, --output Allows for custom output folder

Custom output folder path must be placed right after -o/--output flag

Top comments (0)