npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

@bongo/markdown

0.0.12

@lukeed

npmHomeRepoSnykSocket
Downloads:85
$ npm install @bongo/markdown
DailyWeeklyMonthlyYearly

@bongo/markdown

Markdown loader plugin for bongo, powered by md4x.

Install

bun add @bongo/markdown

Usage

import { markdown } from '@bongo/markdown';

export default {
	plugins: [
		markdown(),
	],
};

The plugin registers an .md loader. Markdown files are converted to HTML content files and frontmatter is exposed as page metadata.

---
title: Hello
tags: docs, markdown
---

# Hello

Options

markdown() accepts md4x HTML options. Syntax highlighting is optional:

import { markdown } from '@bongo/markdown';
import { shiki } from '@bongo/markdown/highlight';

export default {
	plugins: [
		markdown({
			highlighter: shiki({
				theme: 'github-dark',
				langs: ['js', 'ts', 'css', 'bash'],
			}),
		}),
	],
};

Highlighters

Install the highlighter package you want to use:

bun add shiki
bun add sugar-high

Then import from @bongo/markdown/highlight:

import { shiki, sugarhigh } from '@bongo/markdown/highlight';

shiki(options) loads Shiki with the requested theme and languages.

sugarhigh() loads Sugar High.