Markdownツールキット
Markdown を HTML にレンダリング、見出しから目次を抽出。
Markdownツールキットとは
Markdownツールキットは、Markdown を標準的な HTML に変換するツールです。レンダリングモードのほか、見出しを抽出して目次(TOC)を作るモードがあり、コードブロック内の # は見出しと誤認しません。marked ライブラリを使用し、すべての処理はブラウザ内で完結します。
🔒 処理はすべてブラウザ内で完結し、データは送信されません。
このツールの前提
- 処理場所
- このページのブラウザ内(JavaScript / Canvas)
- アップロード
- なし — ファイルは端末の外に出ません
- オフライン
- ページを開いた後は通信不要
CommonMark first, extensions second
The baseline is CommonMark: headings, emphasis, links, lists, block quotes, fenced code, indented code. Everything beyond that — tables, strikethrough, task lists, autolinks — is a GitHub-flavoured extension and is only rendered if the implementation enables it.
This is why the same source renders differently on two sites. A table that shows correctly on GitHub can appear as a paragraph of pipes in a strict CommonMark renderer. When publishing somewhere unfamiliar, check the table and footnote syntax first; those are the two extensions most often missing.
Whitespace is syntax, so formatting can break meaning
Two trailing spaces mean a hard line break; four leading spaces mean a code block; a blank line inside a list item changes whether the following paragraph belongs to the item. A formatter that trims trailing whitespace silently removes every hard break in the document.
Nested list indentation is the other fragile area: two spaces, four spaces or a tab each produce different structures in different parsers. Normalising to a single convention is only safe if the target renderer agrees with it — otherwise the outline depth changes.
Embedded HTML and escaping
Most renderers pass raw HTML through, so a stray < in prose — 'x < y' — can start a tag and swallow the rest of the line. Escaping it as < is the fix, and it is the most common cause of a paragraph disappearing from rendered output.
Escaping also affects characters that are syntax only in context: an asterisk in the middle of a word, an underscore inside an identifier, a leading # in a shell snippet. Fenced code blocks avoid all of it, which is the reason to fence anything that looks like code rather than indenting it.
使い方
- 1.Markdown を貼り付け
- 2.モード(レンダリング/目次)を選択
- 3.実行して結果をコピー
他の方法との比較
同じ変換をする方法は 3 つあります。ブラウザ内(このページ)、サーバー側の変換サービス、デスクトップアプリ。差がつくのは速度ではなく、ファイルがどこへ行くかと、無料でどこまでできるかです。
| 観点 | このツール | サーバー側の変換サービス | デスクトップアプリ |
|---|---|---|---|
| ファイルの処理場所 | このページのブラウザ内 | ベンダーのサーバー(アップロード後) | 自分の PC(アプリをインストール) |
| アカウント | 不要 | 多くの場合必要(無料枠の制限解除に登録を求める) | 不要(ライセンス認証は必要な場合あり) |
| 無料で扱えるサイズ | サイズ制限なし(回数制限もなし) | 数ファイル/時間、または 5〜10MB 程度で課金 wall | ディスクとメモリ次第 |
| 料金 | 無料。Pro は月 $9(大きいファイルと AI 機能のみ) | サブスクが一般的。おおむね月 $7〜15(2026 年 11 月時点) | 買い切り、またはサブスク |
| オフライン | 一度開けば通信不要 | 不可 | 可 |
| 20MB を処理し始めるまで | 待ち時間なし(アップロードが無い) | アップロードが支配的(10Mbps 上りで約 16 秒) | アプリの起動のみ |
| 保証できないこと | 不正な入力は「修復」せず、パーサのエラー位置を返します | 同じ(変換の原理は変わらない) | 同じ。ただし書式の再現はより忠実な場合がある |
サーバー側のサービスが優れている点は明確にあります。巨大なファイル、チームでの共有、変換履歴の管理、スクリプトからの自動化。逆に「1 回だけ、手元のファイルを別形式にしたい」という今回の用途では、アップロードの待ち時間と登録の手間だけが増えます。
よくある質問
対応する Markdown 記法は?
CommonMark 標準(見出し・リスト・表・コードブロック・リンク等)に対応しています。
目次モードの利点は?
見出し構造だけを素早く確認でき、コードブロック内の # を誤って目次に含めません。
この変換で失われるもの
フォーマッタは入力を構文木に解析し、一貫したインデントで出力します。入力が不正なら、黙って壊れたファイルを返すのではなく、パーサのエラー位置を表示します。壊れた JSON は「修復」されず、そのまま壊れたまま示されます。