nonkuri571 downloadsJapanese novel helpers for indentation, ruby/emphasis marks, and character counting.
An Obsidian plugin for writing novels in Japanese. It renders Japanese paragraph indentation correctly, displays ruby (furigana) and emphasis dots written in the Kakuyomu / Aozora Bunko / Narou notations, and counts characters the way Japanese prose is usually counted.
日本語のドキュメントは こちら にあります。
Japanese paragraphs are indented with a full-width space ( ) at the start of the
line. Obsidian's default wrapping misaligns the lines that follow; this plugin
adjusts the display so the indentation stays consistent in Reading view as well as
in Live Preview and Source mode.
漢字《かんじ》
|任意の本文《にんいのほんぶん》
|半角パイプも使用可能《はんかくぱいぷもしようかのう》
The 漢字《かんじ》 form can be used when the base text consists only of kanji. When
the base text contains kana or symbols, mark its range explicitly with | or |.
Aozora Bunko / Narou style, which is really ruby:
|重要《﹅﹅》
Kakuyomu style, rendered with text-emphasis:
《《重要》》
| Command | Description |
|---|---|
Insert ruby |
Wraps the selection as |selection《》. With no selection, inserts |《》. |
Insert emphasis marks |
Adds emphasis markup to the selection, in the format chosen in the settings. |
Remove ruby and emphasis marks from selection |
Strips ruby and emphasis markup from the selection, leaving the base text. |
Copy current section (with heading) |
Copies the heading section the cursor is in, including the heading line, to the clipboard. Nested sub-sections are included. |
Copy current section (without heading) |
The same, but excludes the heading line itself. |
In a file with no headings, both copy commands copy the whole document. If the file has headings but the cursor sits before the first one, the text from the beginning of the file up to that heading is copied.
Characters are counted rather than words. The count is shown in the status bar, and optionally next to each heading for the section it introduces. By default whitespace, line breaks, ruby and emphasis control characters, Obsidian callouts, and Markdown comments are excluded from the count.
When callout exclusion is enabled, editing a callout's title or body also leaves the per-heading count unchanged. Ordinary blockquotes are still counted.
The settings tab is grouped into five sections:
The Japanese section below documents every option with its default value.
This plugin makes no network requests. It reads notes only through the Obsidian API in order to count characters and render markup, and it stores nothing but its own settings. The two "Copy current section" commands write to the system clipboard when you run them; the plugin never reads the clipboard.
Obsidianで日本語小説を書くための補助プラグインです。
次の機能をまとめて提供します。
Japanese Novel Tool を検索します。行頭に全角スペースを入れた日本語の字下げを、できるだけ正しく表示します。 Live Preview / Source modeでは、Obsidian標準の折り返し字下げによるずれを抑えるCSSを適用します。
エディタ(Live Preview / Source mode)で、空白と改行を薄い色のマークとして表示できます。どちらも既定ではオフです。
□→↵(禁則処理と同様にぶら下げ表示され、マークだけが次の行へ送られることはありません)エディタを分割しているとき、いま編集しているペインを見分けやすくします。
強調色は次から選べます。いずれもObsidianのテーマ変数なので、テーマとライト/ダークの切り替えに追従します。
| 選択肢 | 変数 | 挙動 |
|---|---|---|
| アクセント(既定) | --interactive-accent |
「設定 → 外観 → アクセントカラー」で選んだ色に追従します。 |
| リンク色 | --text-accent |
同じくアクセントカラーに追従し、本文中のリンクと同じ色になります。 |
| 赤/オレンジ/黄/緑/シアン/青/紫/ピンク | --color-red など |
色相は固定で、ライト/ダークで明度が切り替わります。アクセントカラーには追従しません。 |
既定では、表示中のエディタが2つ以上あるときだけ強調します。単一ペインでも常に強調したい場合は「分割しているときだけ強調」をオフにしてください。
次の書式のルビをレンダリングして表示します。
漢字《かんじ》
|任意の本文《にんいのほんぶん》
|半角パイプも使用可能《はんかくぱいぷもしようかのう》
漢字《かんじ》 形式は、ルビ対象が漢字のみで構成される場合に使えます。ひらがなや記号を含む語句にルビを振る場合は、| または | で対象範囲を明示してください。
青空文庫・小説家になろう系の傍点(実体はルビ):
|重要《﹅﹅》
カクヨム形式の傍点(text-emphasis):
《《重要》》
ルビと傍点は同時には適用しません。
Obsidianのコマンドパレットから次のコマンドを使えます。
| コマンド | 内容 |
|---|---|
Insert ruby |
選択範囲を |選択範囲《》 で囲みます。未選択時は |《》 を挿入します。 |
Insert emphasis marks |
設定した形式で選択範囲に傍点記法を挿入します。 |
Remove ruby and emphasis marks from selection |
選択範囲からルビ/傍点記法を取り除き、本文だけにします。 |
Copy current section (with heading) |
カーソルが属する見出しセクションを、見出し行を含めてクリップボードにコピーします。配下の小見出しも含みます。 |
Copy current section (without heading) |
同上ですが、カーソルが属する見出し行だけを除いてコピーします。配下の小見出しは含みます。 |
見出しセクションのコピーは、カーソル位置に応じて対象が変わります。
設定画面は次の5グループに分かれています。
| 設定 | 既定値 | 説明 |
|---|---|---|
| 日本語の字下げを表示 | オン | 行頭の全角スペースによる字下げを適切に表示します。 |
| 設定 | 既定値 | 説明 |
|---|---|---|
| 空白を可視化 | オフ | エディタで全角スペース・タブにマークを表示します。 |
| 改行を可視化 | オフ | エディタで行末に改行マーク(↵)を表示します。 |
| 設定 | 既定値 | 説明 |
|---|---|---|
| ルビと傍点を表示 | オン | ルビと傍点記法を表示用HTML/Decorationへ変換します。 |
| カクヨム形式の傍点 | オン | 《《本文》》 を傍点として扱います。 |
| ルビサイズ比率 | 0.5 |
本文サイズに対するルビ文字サイズの比率です。指定できる範囲は 0.1 から 1 です。 |
| 傍点挿入形式 | カクヨム | Insert emphasis marks で使う挿入形式です。 |
| 傍点文字 | ﹅ |
青空文庫・なろう形式で挿入する傍点文字です。 |
青空文庫・なろう形式で傍点を挿入する場合、傍点文字は対象となる文字の数だけ繰り返されます。
例:
|重要《﹅﹅》
| 設定 | 既定値 | 説明 |
|---|---|---|
| アクティブなペインを強調 | オン | 編集対象のペインに枠線またはバーを表示します。 |
| 強調スタイル | 枠線 | 枠線 はペイン全体を囲み、左端のバー は左端だけを細く塗ります。 |
| 強調色 | アクセント | 枠線・バー・カーソル行に使う色です。下の一覧から選べます。 |
| 枠線の太さ | 2 |
「枠線」スタイルのときの線の太さ(px)です。1〜8 を指定できます。 |
| 左端のバーの太さ | 4 |
「左端のバー」スタイルのときのバーの太さ(px)です。1〜16 を指定できます。 |
| カーソル行を強調 | オフ | フォーカス中のエディタで、カーソルのある行に背景色を付けます。 |
| 分割しているときだけ強調 | オン | 表示中のエディタが2つ以上のときだけ、上の強調を有効にします。 |
| 設定 | 既定値 | 説明 |
|---|---|---|
| 文字数を表示 | オン | ステータスバーに文字数を表示します。 |
| 接頭辞 | 空 | ステータスバーの文字数の前に表示する文字列です。 |
| 接尾辞 | 文字 |
ステータスバーの文字数の後に表示する文字列です。 |
| 見出し横にセクション文字数を表示 | オン | 各見出しから次の同じ階層以上の見出しまでを数え、見出し横に表示します。 |
| 空白を数えない | オン | 空白を文字数から除外します。 |
| 改行を数えない | オン | 改行を文字数から除外します。 |
| ルビと傍点の記法を数えない | オン | ルビや傍点の制御文字を除外し、本文部分を数えます。 |
| ObsidianのCalloutを数えない | オン | Calloutブロックを文字数から除外します。 |
| Markdownコメントを数えない | オン | %% コメント %% を文字数から除外します。 |
| 見出しを文字数から除外 | オフ | 見出し行を文字数から除外します。 |
| Markdown制御文字を除外 | オフ | 見出し記号、強調記号、リンク記法などを表示に近い形で数えます。 |
文字数カウントは日本語小説向けに、単語数ではなく文字数を数えます。
既定では次を数えません。
見出し横のセクション文字数は、次の同じ階層または上位階層の見出しまでを対象にします。
「ObsidianのCalloutを数えない」がオンの場合、Calloutのタイトルや本文を編集しても、見出し横の文字数には加算・減算されません。通常の引用ブロックはカウント対象です。
# 第一章
## 一
本文...
## 二
本文...
この場合、## 一 は次の ## 二 まで、# 第一章 は章全体を数えます。
本プラグインは現状のまま提供されます。作者は、本プラグインの使用または使用不能によって生じたいかなる損害についても責任を負いません。
本プラグインの動作について正確性や完全性を保証するものではありません。利用者の責任においてご使用ください。
本プラグインは予告なく仕様変更、更新、公開停止される場合があります。
createSpan / createEl / createFragment に統一builtin-modules 依存を Node 標準の node:module に置き換えLICENSE を追加Copy current section (with heading)(見出し行を含む)Copy current section (without heading)(見出し行を除く)