Skip to content

A text converter from markdown to html, using unified.js and Bun.

Notifications You must be signed in to change notification settings

shotanue/md2hype

Repository files navigation

md2hype

lint test

A text converter that transforms markdown into HTML, powered by unified.js and bun.sh.

Built-in unifiedjs plugins

  • remark-breaks
  • remark-frontmatter
  • remark-gfm
  • remark-parse

Installation

md2hype is easily installable via Homebrew, built with a JavaScript runtime bun.sh:

brew install shotanue/tap/md2hype

How to Use

Basic Conversion

Convert a markdown file (foo.md) to HTML, including both HTML content and parsed frontmatter in JSON format:

md2hype --file foo.md

Example Input (foo.md):

---
tag:
  - foo
---
hello world

Example Output:

{
  "html": "<p>hello world</p>",
  "frontmatter": {
    "tag": ["foo"]
  }
}

HTML-Only Output

For scenarios where only the HTML output is required, excluding frontmatter:

md2hype --file foo.md --html

Example Output:

<p>hello world</p>

Additional Features

  • Standard Input Support: md2hype can also be used with standard input (stdin).

    cat foo.md | md2hype
  • Help Option: For more information about the usage and options, use the --help or -h flag.

    md2hype --help

About

A text converter from markdown to html, using unified.js and Bun.

Resources

Stars

Watchers

Forks

Packages

No packages published