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

@edv4h/usketch-plugin-shape-markdown

v0.1.9

Published

Markdown を整形表示する uSketch の shape プラグイン。付箋 / テキストと同じ HTML 描画 shape として、GFM 記法・シンタックスハイライト・Mermaid 図をキャンバス上でレンダリングする。

Downloads

4,541

Readme

@edv4h/usketch-plugin-shape-markdown

Markdown を整形表示する uSketch の shape プラグイン。付箋 / テキストと同じ HTML 描画 shape として、GFM 記法・シンタックスハイライト・Mermaid 図をキャンバス上でレンダリングする。

特徴

  • shape 型 markdownShapeData<{ source: string; isEditing: boolean }>meta 方式、renderTarget: "html")。
  • GFM レンダリング: 見出し / 太字・斜体 / リスト / リンク / 表 / コードブロック / タスクリスト(チェックボックス)/ 引用。react-markdown + remark-gfm
  • XSS 安全: dangerouslySetInnerHTML を使わず、raw HTML は既定で無効。悪意ある <script> 等はレンダリングされない。
  • シンタックスハイライト: rehype-highlight(github 風テーマを内蔵注入、ライト/ダーク追従)。
  • Mermaid: ```mermaid ブロックを図として描画。mermaid動的 import で code-split(図を含むボードを開いたときだけロード)。securityLevel: "strict" で描画し、不正構文は生コード+エラー文言にフォールバック。
  • 編集(明示操作): shape を選択し、Control HUD の Markdown ▸ ✎ Edit source(バッククォート ` で HUD を開く)で raw Markdown 編集モードに入る。blur / Esc / 外側クリック / 選択解除で確定。undo 対応。空にすると shape は削除。ダブルクリックにはバインドしない(コンテンツ操作を邪魔しないため)。
  • コンテンツ操作(選択中のみ): shape 選択中はリンククリック可+テキスト選択は Alt+ドラッグ(プレーンなドラッグは shape の移動、Alt を押しながらドラッグでテキスト選択)。未選択時はコンテンツ非操作(リンクも押せない)で、クリック/ドラッグは shape の選択/移動になる。
  • ペースト / ドロップ: キャンバスにペースト(Cmd/Ctrl+V)またはドロップで markdown shape を自動生成(external-content handler)。
    • 表データ(Excel / Google スプレッドシートの HTML table、TSV/CSV)→ GFM 表に変換(order:10)。
    • それ以外のテキスト → そのまま Markdown(catch-all order:0、host が上書き可)。
    • =「具体 match が勝ち/無ければ Markdown」という order ベースのルーティング(専用ルータープラグイン不要。canvas-engine の externalContent レジストリがルーターを担う)。
    • 内部シェイプコピー(usketch/shapes JSON)は横取りしない。編集中の textarea へのペーストはブラウザ標準動作。
  • 高さ自動フィット: 表示は描画内容に追従(Mermaid の非同期描画にも ResizeObserver で追従)。
  • ツール markdown-draw(ショートカット m)、LOD 簡易表示、AI serialize、Debug HUD の debug fields 対応。

非対応(今後)

  • KaTeX 数式。
  • ボード全体の Markdown インポート / エクスポート。

使い方

import { createApp } from "@edv4h/usketch-core";
import { createMarkdownPlugin } from "@edv4h/usketch-plugin-shape-markdown";

const app = await createApp({
  store,
  plugins: [createMarkdownPlugin()],
});

ツールバー / ショートカット m で配置(配置直後は編集モード)→ 確定後に再編集するときは shape を選択し、Control HUD(` で開く)の Markdown ▸ ✎ Edit source を実行 → フォーカスを外す / Esc で整形表示に切り替わる。