漢文HTML


这是一款汉文训读转换与排版工具(可能是目前网上最好的),同时支持疏排(アキ組)和密排(ベタ組)。输入带标注的汉文文本,点击,即可将其转换为HTML显示。

This is a kanbun kundoku (漢文訓読) conversion and display tool (probably the best on the Internet) supporting both fixed inter-character spacing setting (アキ組) and solid setting (ベタ組). Enter annotated kanbun text and click “Convert” to convert it to HTML and display it.

插入:Insert:
字号Font size
汉文窗口高度(单位:字高)Kanbun windows height (in em)
以下是简要文档:(目前仅英文版)
The following is a brief documentation:

Usage

<link href="kanbun.css" rel="stylesheet" />
<script src="kanbun.js"></script>
<div class="kanbun okurigana-sinking" id="sample">
  <p>感ジテハ[レ]時ニ花ニモ濺(そそ)ギ[レ]淚ヲ,恨ミデハ[レ]別レヲ鳥ニモ驚カス[レ]心ヲ。</p>
  <p>孤之有ルハ[二]孔明[一],猶ホ‹ごと›«キ»[二]魚之有ルガ[一レ]水也。</p>
</div>
<script>convertKanbunDiv(document.getElementById("sample"));</script>

Put annotated kanbun paragraphs in a <div>, and call convertKanbunDiv() to convert them to HTML.

Kanbun Annotation

Different components after kanji are annotated by different brackets:

  • ( ): furigana (振り仮名)
  • { }: okurigana (送り仮名) (these brackets can be omitted)
  • ‹ ›: furigana (振り仮名) of saidokumoji (再読文字)
  • « »: okurigana (送り仮名) of saidokumoji (再読文字)
  • [ ]: kaeriten (返り点)
  • Punctuation (no annotation)

This is the recommended order of components after one kanji in kanbun annotation. However, in practice, they will be displayed correctly in any order.

Class Description

Several class values can be given to the kanbun <div>:

  • kanbun: Display in kanbun style
  • betagumi: Use solid setting (ベタ組) (the default is fixed inter-character spacing setting (アキ組))
  • okurigana-sinking: Make okurigana (送り仮名) sink 1/4 em height when without furigana (振り仮名)
  • split-touching-kana: When using solid setting (ベタ組), insert 1/4 em spacing between two adjacent kanji if their kana touch with each other
  • furigana-center-align: When using solid setting (ベタ組), align furigana (振り仮名) to the center of kanji when it is the only kana of this kanji
  • show-borders: Show borders of elements (for debugging)

Special Thanks

References