Skip to content

mastrojs/markdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@mastrojs/markdown

A few simple helper functions to generate HTML from markdown. Just enough to get you started with markdown with Mastro.

Uses micromark with micromark-extension-gfm under the hood.

Install

Deno

deno add jsr:@mastrojs/markdown

Node.js

pnpm add jsr:@mastrojs/markdown

Bun

bunx jsr add @mastrojs/markdown

Usage

import { markdownToHtml } from "@mastrojs/markdown";

const { content, meta } = markdownToHtml(`
---
title: my title
---

hi *there*
`),

To see all functions @mastrojs/markdown exports, see its API docs.

For a tutorial, read the following chapter in the Mastro Guide: A static blog from markdown files