A text converter that transforms markdown into HTML, powered by unified.js and bun.sh.
remark-breaks
remark-frontmatter
remark-gfm
remark-parse
md2hype is easily installable via Homebrew, built with a JavaScript runtime bun.sh:
brew install shotanue/tap/md2hype
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"]
}
}
For scenarios where only the HTML output is required, excluding frontmatter:
md2hype --file foo.md --html
Example Output:
<p>hello world</p>
-
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