md-forge is a lightweight and simple Markdown to HTML converter, designed specifically for use by the kBxAc
team.
- Converts Markdown headings (
#
,##
, etc.) to HTML headings. - Supports bold, italic, and
strikethroughtext. - Parses code blocks and preserves their language for syntax highlighting.
- Handles basic text links and image-based links.
- Comes with a command-line interface (CLI) for seamless usage.
- Lists and Grids
- Tables
- Inline Code
To install md-forge, clone the repository and install it globally:
git clone https://github.com/kBxAc/md-forge
cd md-forge
npm install -g
You can use md-forge from the command line:
md-forge --input <input-file> --output <output-file>
--help
or-h
: Display help information--version
or-v
: Display version information--input <input-file>
or-i <input-file>
: Specify the input markdown file--output <output-file>
or-o <output-file>
: Specify the output HTML file
md-forge --input test/test.md --output test/test.html
import { parseMarkdown } from "md-forge";
import fs from "fs";
// Read the md file
md = fs.readFileSync("test/test.md", "utf-8");
// Convert md to html
html = parseMarkdown(md);
// Save the html
fs.writeFileSync("test/test.html", html);