Markdown-pdf

Markdown PDF Viewer

Markdown PDF Viewer icon

日本語 / English

日本語

Markdown PDF Viewer は、GitHub 上の Markdown を、ワンクリックでPDF風に表示・印刷できる Chrome / Edge 拡張機能です。

設計メモ、研究資料、FPGA関連ドキュメント、技術仕様書など、Markdownで管理している資料を見やすく確認・印刷するためのツールです。

こんな人におすすめ

サンプル

日本語サンプルプレビュー

機能

インストール

開発用インストール

  1. Chrome または Edge を開きます。
  2. chrome://extensions または edge://extensions を開きます。
  3. デベロッパーモードを有効にします。
  4. パッケージ化されていない拡張機能を読み込む を選びます。
  5. このリポジトリ内の extension/ フォルダを選択します。

ファイルを変更した後は、拡張機能ページで拡張機能を再読み込みし、対象のMarkdownページも再読み込みしてください。

使い方

GitHubのMarkdownページを開きます。

https://github.com/nagito-hiroshima/Markdown-pdf/blob/main/samples/sample-document.md

ページ上部に追加される PDF表示 ボタンを押します。

Raw URLでも同じように使えます。

https://raw.githubusercontent.com/nagito-hiroshima/Markdown-pdf/refs/heads/main/samples/sample-document.md

拡張機能アイコンをクリックすると、現在のタブ、手入力URL、ローカル .md ファイルからも開けます。

構成

パス 役割
extension/ Chrome / Edge 拡張機能本体
extension/manifest.json Chrome拡張の設定
extension/_locales/ 日本語・英語の翻訳
extension/i18n.js 拡張機能画面の翻訳適用
extension/background.js content script から依頼されたビューアタブを開く
extension/content-script.js GitHub Markdownページにボタンを追加
extension/popup.html / extension/popup.js / extension/popup.css 拡張機能ポップアップ
extension/viewer.html / extension/viewer.js / extension/viewer.css PDF風Markdownビューア
.github/workflows/validate.yml 検証用GitHub Actions
.github/workflows/release.yml 自動リリース用GitHub Actions
architecture.md 要件・設計メモ

検証

node --check extension/background.js
node --check extension/content-script.js
node --check extension/i18n.js
node --check extension/markdown.js
node --check extension/popup.js
node --check extension/viewer.js
node -e "JSON.parse(require('fs').readFileSync('extension/manifest.json','utf8'))"

リリース

タグをpushすると、GitHub Actionsが配布パッケージ内の extension/manifest.jsonversion をタグに合わせてから、配布用zipを作成してReleaseを公開します。

git tag v1.0.0
git push origin v1.0.0

GitHubのActions画面から Release ワークフローを手動実行することもできます。その場合も v1.0.0 のようなタグ名を指定してください。

配布zipは、展開したフォルダの直下に manifest.json が見える形で作成されます。

English

Markdown PDF Viewer is a Chrome / Edge extension that opens Markdown files from GitHub or GitHub Raw URLs in a clean, PDF-style browser preview.

It is intended for design notes, research documents, FPGA documentation, technical specifications, and other Markdown-based documents that need to be reviewed or printed neatly.

Sample

English sample preview

Features

Install for Development

  1. Open Chrome or Edge.
  2. Go to chrome://extensions or edge://extensions.
  3. Enable developer mode.
  4. Choose Load unpacked.
  5. Select the extension/ folder in this repository.

After changing files, reload the extension from the extensions page and then reload the target Markdown page.

Usage

Open a Markdown file on GitHub.

https://github.com/nagito-hiroshima/Markdown-pdf/blob/main/samples/sample-document-en.md

Use the buttons added near the top of the page.

Raw URLs work the same way.

https://raw.githubusercontent.com/nagito-hiroshima/Markdown-pdf/refs/heads/main/samples/sample-document-en.md

You can also use the extension popup to open the current tab, enter a Markdown URL manually, or open a local .md file.

Project Files

Path Purpose
extension/ Chrome / Edge extension source
extension/manifest.json Chrome extension manifest
extension/_locales/ English and Japanese translations
extension/i18n.js Applies translations in extension pages
extension/background.js Opens viewer tabs from content scripts
extension/content-script.js Adds page buttons to GitHub Markdown pages
extension/popup.html / extension/popup.js / extension/popup.css Extension popup UI
extension/viewer.html / extension/viewer.js / extension/viewer.css PDF-style Markdown viewer
.github/workflows/validate.yml Validation GitHub Actions workflow
.github/workflows/release.yml Automated release GitHub Actions workflow
architecture.md Architecture and requirements notes

Development Checks

node --check extension/background.js
node --check extension/content-script.js
node --check extension/i18n.js
node --check extension/markdown.js
node --check extension/popup.js
node --check extension/viewer.js
node -e "JSON.parse(require('fs').readFileSync('extension/manifest.json','utf8'))"

Release

When you push a release tag, GitHub Actions updates the packaged extension/manifest.json version to match the tag, creates a release zip, and publishes a GitHub Release.

git tag v1.0.0
git push origin v1.0.0

You can also run the Release workflow manually from the GitHub Actions page. Use a tag name such as v1.0.0.

The release zip is created so that manifest.json is directly visible at the extracted folder root.