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

@azamiharu/marked-aozora-ruby

v1.0.0

Published

青空文庫ライクな|ルビ《ふりがな》をサポートする marked 拡張機能

Readme

@azamiharu/marked-aozora-ruby

青空文庫ライクなルビ(|漢字《かんじ》 または 漢字《かんじ》)をサポートする marked 拡張機能です。

使い方

import { markedAozoraRuby } from "@azamiharu/marked-aozora-ruby";
import { marked } from "marked";

marked.use(markedAozoraRuby());

const html = marked.parse("漢字《かんじ》");
// <p><ruby>漢字<rp>《</rp><rt>かんじ</rt><rp>》</rp></ruby></p>

変換仕様

  • 明示的な開始記号: (全角)または |(半角)[^1] を使用すると、その直後から までをルビ対象とします。
  • 自動認識: 開始記号がない場合、 の前後にある同一文字種(漢字、ひらがな、カタカナ、アルファベット)の連続を自動的にルビとして認識します。
    • 注意1: 漢字とひらがなが混在する場合(例:食べ物《たべもの》)は、直前の同一文字種のみが抽出されます(この例では だけがルビ対象となります)。送り仮名を含む単語全体にルビを振る場合は、|食べ物《たべもの》 のように開始記号を使用してください。
    • 注意2: ひらがなとカタカナは別種です。混在する場合(例:一弗《いちドル》)は、 をルビ注釈として認識しません。|一弗《いちドル》 のように開始記号を使用するか、一《いち》弗《ドル》 のように分割してください。
  • エスケープ: |《 または |《 は、記号としての に変換されます[^1]。

詳細な挙動

  • インライン装飾: ルビ対象( の間)には、強調などの Markdown インライン要素を含めることができます。
    • 注意: ルビ注釈( の間)には含めることができません。
  • HTMLエスケープ: ルビ内の <& などの特殊文字は安全にエスケープされます。

[^1]: |(半角) |《 |《 は青空文庫注記の仕様ではありませんが、複数の有名な小説投稿サイトで採用されているため、実用性を重視して実装しています。