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

@mirrordown/sat-ruby

v0.2.2

Published

A Sätteri plugin for ruby annotation syntax ({base|reading}), rendering <ruby> elements.

Readme

@mirrordown/sat-ruby

Part of Mirrordown — a suite of markdown syntax extensions for the unified, markdown-it and Sätteri ecosystems.

A Sätteri plugin for the ruby syntax extension.

Overview

The ruby plugin renders {base|reading} as HTML <ruby> annotations, used for pronunciation guides in East Asian text.

<ruby>base<rt>reading</rt></ruby>

Syntax

Use {base text|reading} inline to annotate characters with their pronunciation or reading:

{漢字|かんじ} are Chinese-derived characters used in Japanese writing.

{東京|とうきょう} is the capital of Japan.

A ruby is written on one line, and its first | splits it: the base holds no {, } or | (though it may start with {), and the reading runs to the next }. Spaces and tabs around the base and around the reading are dropped. A brace group without a |, such as an attribute block ({.class}), is never a ruby, and a ruby written right after one still is. A base or a reading left empty ({|reading}, {base|}) is not a ruby either. Write \{ to keep a brace literal. In a table cell, write the separator as \|.

The base and the reading are inline markup, so formatting and links work inside them, and so does what the other inline plugins read ({--a--|==b==}). Because the first | is always the separator, braces around a spoiler are today read as a ruby: {note: ||secret||} renders note: with |secret|| printed above it.

Optionally pass rp, a pair of parentheses to wrap the reading in <rp> elements, for browsers that don't support ruby. Every engine takes the option: .use(remarkRuby, { rp: ["(", ")"] }), md.use(ruby, { rp: ["(", ")"] }) and satteriRuby({ rp: ["(", ")"] }).

<ruby>漢字<rp>(</rp><rt>かんじ</rt><rp>)</rp></ruby>

Install

npm install @mirrordown/sat-ruby

It parses each base and reading on its own, with the document's features. List it first among the mdast plugins, since it re-reads its blocks from source: listed after a plugin that has already rebuilt a block, it only finds a ruby that sits whole inside one text node. The Sätteri preset does this for you.

With Sätteri's attributes feature on, a brace group that ends a block is read as an attribute block before any plugin runs, so a ruby there whose base starts with . or #, or holds =, is lost ({.NET|ドットネット} alone on a line). Put text after such a ruby.

With that feature on, an attribute block written right after a ruby goes on the ruby ({漢字|かんじ}{.name}), as it does with the attrs plugins of the other engines. One difference is the parser's: a table cell that holds a ruby holds an escaped pipe, and Sätteri reads no block of the cell's own there, so | {漢字\|かんじ} {.name} | keeps {.name} as text.

Standalone

import { markdownToHtml } from "satteri";
import { satteriRuby } from "@mirrordown/sat-ruby";

const { html } = markdownToHtml(source, {
  mdastPlugins: [satteriRuby()],
});

Astro

// astro.config.ts
import { defineConfig } from "astro/config";
import { satteri } from "@astrojs/markdown-satteri";
import { satteriRuby } from "@mirrordown/sat-ruby";

export default defineConfig({
  markdown: {
    processor: satteri({ mdastPlugins: [satteriRuby()] }),
  },
});

Documentation

Full documentation, more examples, and configuration options: github.com/mirrordown/mirrordown (dedicated docs site coming soon).

License

MIT © Drake Costa