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

@j2masamitu/md2pdf-ja

v1.1.4

Published

Convert Japanese Markdown files to beautiful PDFs with math equations, alerts, and footnotes support

Readme

md2pdf-ja

日本語のMarkdownファイルを美しいPDFファイルに変換するツールです。日本語フォント、禁則処理、適切な行間設定など、日本語文書に最適化されています。

特徴

  • 日本語フォント(Noto Sans JP / Noto Serif JP)に対応
  • GitHub Flavored Markdown (GFM) サポート
  • 数式のレンダリング(KaTeX) - インライン数式 $...$ とブロック数式 $$...$$ に対応
  • GitHubアラート - [!NOTE], [!WARNING], [!IMPORTANT] などの警告ブロック
  • 脚注機能 - 学術文書やレポート向けの脚注サポート
  • 見出しIDの自動生成 - GitHubスタイルの見出しID
  • 目次の自動生成 - --toc オプションで目次を生成
  • ローカル画像サポート - 絶対パス・相対パスの画像を自動変換(Windows/Mac/Linux対応)
  • シンタックスハイライト対応
  • 複数のテーマ(デフォルト、学術、ビジネス)
  • カスタムCSSサポート
  • 用紙サイズ指定(A4, A5, B5, Letter)

インストール

npm install -g @j2masamitu/md2pdf-ja

開発環境セットアップ

git clone https://github.com/j2masamitu/md2pdf-ja
cd md2pdf-ja
npm install
npm run build

ローカルでグローバルインストール(テスト用)

npm run build
npm link

使い方

基本的な使い方(グローバルインストール後)

md2pdf-ja sample.md

オプション

# 出力ファイルを指定
md2pdf-ja input.md -o output.pdf

# タイトルと著者を指定
md2pdf-ja input.md -t "ドキュメントタイトル" -a "著者名"

# テーマを指定
md2pdf-ja input.md --theme academic

# 用紙サイズを指定
md2pdf-ja input.md --format B5

# カスタムCSSを使用
md2pdf-ja input.md --css custom.css

開発環境での使い方

# 開発モード
npm run dev sample.md

# または、ビルド後
node dist/cli.js sample.md

利用可能なオプション

  • -o, --output <path>: 出力PDFファイルパス
  • -t, --title <title>: ドキュメントのタイトル
  • -a, --author <author>: 著者名
  • --theme <theme>: テーマ (default, academic, business)
  • --format <format>: 用紙サイズ (A4, A5, B5, Letter)
  • --css <path>: カスタムCSSファイルのパス
  • --page-numbers: ページ番号を追加
  • --toc: 目次を生成

新機能の使い方

数式(Math Equations)

インライン数式は $...$ で、ブロック数式は $$...$$ で囲みます。

インライン数式: $E = mc^2$

ブロック数式:
$$
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$

GitHubアラート(Alerts)

5種類のアラートタイプが利用できます。

> [!NOTE]
> 重要な情報を示すノート

> [!TIP]
> 便利なヒントやアドバイス

> [!IMPORTANT]
> 非常に重要な情報

> [!WARNING]
> 注意が必要な警告

> [!CAUTION]
> 危険性についての注意喚起

脚注(Footnotes)

この文章には脚注があります[^1]。

[^1]: これは脚注の内容です。

目次の生成

--toc オプションを使用すると、見出しから自動的に目次を生成します。

md2pdf-ja document.md --toc -o output.pdf

画像の埋め込み

ローカル画像は自動的にfile://プロトコルに変換されます。

<!-- 相対パス -->
![図1](./images/diagram.png)

<!-- 絶対パス(Windows) -->
![図2](C:\Users\user\images\chart.png)

<!-- 絶対パス(Mac/Linux) -->
![図3](/home/user/images/photo.jpg)

<!-- URL -->
![図4](https://example.com/image.png)

すべてのパス形式に対応しています。

テーマ

デフォルト

標準的な読みやすいスタイル

academic

学術論文向けのフォーマット

business

ビジネス文書向けのフォーマット

技術スタック

  • TypeScript
  • Puppeteer (PDF生成)
  • marked (Markdown解析)
  • Commander (CLI)
  • Noto Sans/Serif CJK JP (日本語フォント)

ライセンス

MIT