Skip to content

osteph32/markdown-to-html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markdown to HTML Converter

Rust command line tool written that converts Markdown files into HTML pages. Supports tables, strikethrough, code blocks, and more.


Getting Started

Prerequisites

  • Rust (includes cargo)

Installation

# Clone the repo
git clone https://github.com/osteph32/markdown-to-html.git
cd markdown-to-html

Build

cargo build --release

The compiled binary will be at ./target/release/markdown-to-html.


Usage

cargo run -- <file.md>

Or with the compiled binary:

./target/release/markdown-to-html <file.md>

Example

cargo run -- README.md

This will produce a README.html file in the same directory as the input file.


Supported Markdown Features

  • Headings, paragraphs, blockquotes
  • Bold, italic, strikethrough
  • Ordered and unordered lists
  • Inline code and fenced code blocks
  • Tables
  • Links and images

How It Works

  1. Reads the input .md file from the command-line argument
  2. Parses it using pulldown-cmark with extended options enabled
  3. Converts the parsed tokens to an HTML body string
  4. Wraps the body in a full HTML page with minimal built-in CSS styling
  5. Writes the result to a .html file with the same base name as the input

Tech Stack

Language Rust
Crate pulldown-cmark
Build Tool Cargo

License

MIT

About

Markdown to HTML converter made in Rust

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors