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

@k-l-lambda/lilylet-markdown

v0.1.27

Published

Markdown-it plugin for rendering Lilylet music notation

Readme

lilylet-markdown

A markdown-it plugin for rendering Lilylet music notation in Markdown.

Features

  • Render Lilylet notation in fenced code blocks
  • Server-side SVG rendering with Verovio
  • Client-side rendering support (placeholder mode)
  • Supports lilylet and lyl language aliases

Installation

npm install @k-l-lambda/lilylet-markdown

Usage

Basic Usage (Placeholder Mode)

When no Verovio toolkit is provided, the plugin outputs placeholders with embedded MEI data for client-side rendering:

import MarkdownIt from 'markdown-it';
import lilyletPlugin from '@k-l-lambda/lilylet-markdown';

const md = new MarkdownIt();
md.use(lilyletPlugin);

const result = md.render(`
# My Score

\`\`\`lilylet
\\key c \\major
\\time 4/4
c'4 d' e' f' | g'1
\`\`\`
`);

Output:

<h1>My Score</h1>
<div class="lilylet-container" data-lilylet data-source="..." data-mei="..."></div>

Server-side SVG Rendering

For server-side rendering, initialize Verovio and pass it to the plugin:

import MarkdownIt from 'markdown-it';
import lilyletPlugin, { initVerovio, prerender } from '@k-l-lambda/lilylet-markdown';

async function render(content) {
  // Initialize Verovio
  const verovioToolkit = await initVerovio();

  // Create markdown-it instance with plugin
  const md = new MarkdownIt();
  md.use(lilyletPlugin, { verovioToolkit });

  // Pre-render all lilylet blocks (async)
  await prerender(md, content, { verovioToolkit });

  // Render markdown (sync)
  return md.render(content);
}

Options

interface LilyletPluginOptions {
  // Initialized Verovio toolkit instance
  verovioToolkit?: VerovioToolkit;

  // Verovio rendering options
  verovioOptions?: {
    scale?: number;        // Default: 40
    pageWidth?: number;    // Default: 2000
    adjustPageHeight?: boolean;  // Default: true
  };

  // Language aliases that trigger rendering
  langAliases?: string[];  // Default: ['lilylet', 'lyl']

  // CSS class for container
  containerClass?: string; // Default: 'lilylet-container'

  // CSS class for errors
  errorClass?: string;     // Default: 'lilylet-error'

  // Include source in data attribute
  includeSource?: boolean; // Default: true
}

Markdown Syntax

Use fenced code blocks with lilylet or lyl language identifier:

```lilylet
\key g \major
\time 3/4
d'4 g' b' | d''2.
```

Or using the short alias:

```lyl
c'4 d' e' f' | g'1
```

Client-side Rendering

For client-side rendering, use the embedded MEI data:

import createVerovioModule from 'verovio/wasm';

document.querySelectorAll('[data-lilylet]').forEach(async (container) => {
  const mei = container.dataset.mei;
  if (!mei) return;

  const verovio = await createVerovioModule();
  const toolkit = new verovio.toolkit();
  toolkit.loadData(mei);
  container.innerHTML = toolkit.renderToSVG(1);
});

Similar Projects

License

ISC