htmgenie is a command-line interface (CLI) tool designed to convert Markdown files to their HTML equivalents.
Before you begin, make sure you have the following prerequisites installed:
You'll need Go version 1.22 or higher for compiling the CLI and managing other dependencies.
-
Windows: Download and install make. Alternatively, if you have Chocolatey installed, you can run the following command in an admin command prompt:
choco install make
-
Mac: Use Homebrew to install make by running the following command in the terminal:
brew install make
Make sure you set the following environment variable to customize the output path for generated html file:
HTMGENIE_OPATH
: Override the default path set to current directory.
To install the CLI, follow these steps:
- Clone this repository to your local machine.
- Navigate to the project directory.
- Run the following commands:
make build
make install
Once the CLI is installed, you can use the following syntax to generate HTML from Markdown files:
htmgenie generate -f <filename_with_path>
This command converts a Markdown file to its HTML equivalent and saves the result to a new file. The tool supports a subset of Markdown syntax and generates HTML tags accordingly.
The generate
command supports the following flags:
-f, --file
: Specifies the input Markdown file to be converted to HTML. Only.md
files are accepted.
For more information, you can use the --help
flag with the generate
command:
htmgenie generate --help
A detailed design is available here
- Cobra - Interface used to create CLI interface
- Cobra CLI - To generate scaffolded framework with cobra layout
- gomponents - Potential library that provides a rich library to create html structs to build the response. It provides better readability model.