Getting Started
Install bbmd and start building type-safe Markdown documents in TypeScript.
Getting started
Run the install command using your package manger of choice:
npm install bbmdyarn add bbmdpnpm add bbmdThen import b anywhere in your application:
import b from "bbmd";Features
- Full support for standard, extended, and Github Flavored Markdown syntax specifications
- Additional support for common Markdown hacks like underlines, comments, details, and image captions
- Sub-document and section handling renders your blocks perfectly wherever they're injected
- Concise chaining API that focuses on terseness
- Simple return interfaces enable easy typing for document factories
- Automatic parsing using
b.md``.parse()enables quick adoption - Documents convert to strings automatically using
String(doc)or template literals using${doc}and support.toString() - Zero dependencies and minimal bundle size
Learn
Basic usage
Learn the basics of Bbmd including creating blocks, composing documents, expressing conditions, and rendering content.
Creating blocks
Learn how to create blocks using functional composition, template literals, or by parsing existing markdown.
Expressing conditions
Learn how to use conditions to control the inclusion and transformation of content.
Tagged template literals
Learn how to use tagged template literals to write concise and readable block content.
Rendering options
Learn how to customize the rendering of your documents with rendering options.
All blocks
Documents and sections
Learn how Bbmd embeds documents, collects footnotes, and manages heading depth.
Standard
Headings, paragraphs, bold, italic, links, images, code, blockquotes, lists, and more.
Extended
Highlight, subscript, superscript, footnotes, tables, and math.
GitHub Flavored
Strikethrough, task lists, emoji, and blockquote alerts.
Hacks
Comments, collapsible details, and underline via HTML.