npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wireweave/markdown-plugin

v1.2.3

Published

Markdown plugins for wireweave

Readme

Installation

npm install @wireweave/markdown-plugin
# or
pnpm add @wireweave/markdown-plugin
# or
yarn add @wireweave/markdown-plugin

Supported Libraries

  • markdown-it - Most popular Markdown parser
  • marked - Fast Markdown compiler
  • remarkable - Markdown parser with CommonMark support

Quick Start

markdown-it

import MarkdownIt from 'markdown-it';
import { markdownItWireframe } from '@wireweave/markdown-plugin';

const md = new MarkdownIt();
md.use(markdownItWireframe, {
  format: 'svg-img',  // or 'html', 'html-preview', 'svg'
  theme: 'light',     // or 'dark'
});

const html = md.render(`
# My Documentation

\`\`\`wireframe
page {
  card p=4 {
    title "Login"
    input "Email" inputType=email
    input "Password" inputType=password
    button "Sign In" primary
  }
}
\`\`\`
`);

marked

import { marked } from 'marked';
import { markedWireframe } from '@wireweave/markdown-plugin';

marked.use(markedWireframe({
  format: 'svg-img',
  theme: 'light',
}));

const html = marked.parse(`
# Documentation

\`\`\`wireframe
page { button "Click me" primary }
\`\`\`
`);

remarkable

import { Remarkable } from 'remarkable';
import { remarkableWireframe } from '@wireweave/markdown-plugin';

const md = new Remarkable();
remarkableWireframe(md, {
  format: 'svg-img',
  theme: 'light',
});

const html = md.render(`
\`\`\`wireframe
page { card { text "Hello" } }
\`\`\`
`);

Options

All plugins accept the same options:

| Option | Type | Default | Description | |--------|------|---------|-------------| | format | 'html' \| 'html-preview' \| 'svg' \| 'svg-img' | 'svg-img' | Output format | | theme | 'light' \| 'dark' | 'light' | Theme for rendering | | containerClass | string | 'wireframe-container' | CSS class for wrapper div | | errorHandling | 'code' \| 'error' \| 'both' | 'both' | How to handle parse errors | | containerWidth | number | 0 | Container width for preview scaling (0 = no scaling) | | maxScale | number | 1 | Maximum scale factor (prevents upscaling beyond this value) |

Output Formats

  • svg-img (default): Base64-encoded SVG in an <img> tag. Best for compatibility.
  • svg: Inline SVG. Allows CSS styling but may conflict with page styles.
  • html: Full HTML/CSS rendering. Interactive but may conflict with page styles.
  • html-preview: HTML with preview container that supports scaling to fit container width.

Error Handling

  • both (default): Shows both error message and original code
  • error: Shows only the error message
  • code: Shows only the original code

Standalone Rendering

You can also use the renderWireframe function directly:

import { renderWireframe } from '@wireweave/markdown-plugin';

const html = renderWireframe(`
  page { button "Click" primary }
`, {
  format: 'html-preview',
  theme: 'light',
  containerClass: 'my-wireframe',
  containerWidth: 600,  // Scale to fit 600px width
});

Styling

Add CSS to style the wireframe containers:

.wireframe-container {
  margin: 1rem 0;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.wireframe-container img {
  display: block;
  max-width: 100%;
  height: auto;
}

.wireframe-error {
  color: #d32f2f;
  background: #ffebee;
  padding: 1rem;
  margin: 0;
}

.wireframe-source {
  background: #f5f5f5;
  padding: 1rem;
  margin: 0;
  overflow-x: auto;
}

Integration Examples

VitePress / VuePress

// .vitepress/config.ts
import { markdownItWireframe } from '@wireweave/markdown-plugin';

export default {
  markdown: {
    config: (md) => {
      md.use(markdownItWireframe);
    },
  },
};

Docusaurus

// docusaurus.config.js
const { markdownItWireframe } = require('@wireweave/markdown-plugin');

module.exports = {
  presets: [
    [
      '@docusaurus/preset-classic',
      {
        docs: {
          remarkPlugins: [],
          rehypePlugins: [],
        },
      },
    ],
  ],
  // For markdown-it based setup
};

Astro

// astro.config.mjs
import { markdownItWireframe } from '@wireweave/markdown-plugin';

export default {
  markdown: {
    remarkPlugins: [],
    rehypePlugins: [],
    // For markdown-it integration
  },
};

API Reference

markdownItWireframe(md, options?)

Plugin for markdown-it.

import type MarkdownIt from 'markdown-it';
import type { WireframePluginOptions } from '@wireweave/markdown-plugin';

function markdownItWireframe(
  md: MarkdownIt,
  options?: WireframePluginOptions
): void;

markedWireframe(options?)

Extension for marked.

import type { MarkedExtension } from 'marked';
import type { WireframePluginOptions } from '@wireweave/markdown-plugin';

function markedWireframe(
  options?: WireframePluginOptions
): MarkedExtension;

remarkableWireframe(md, options?)

Plugin for remarkable.

import type { Remarkable } from 'remarkable';
import type { WireframePluginOptions } from '@wireweave/markdown-plugin';

function remarkableWireframe(
  md: Remarkable,
  options?: WireframePluginOptions
): void;

renderWireframe(code, options?)

Standalone render function.

import type { WireframePluginOptions } from '@wireweave/markdown-plugin';

function renderWireframe(
  code: string,
  options?: WireframePluginOptions
): string;

License

MIT